【问题标题】:Xcode project files in version control版本控制中的 Xcode 项目文件
【发布时间】:2019-04-19 06:29:34
【问题描述】:

尝试提取最新消息,我收到以下消息:

Igors-MacBook-Air:dbhandler igorkorot$ git pull
warning: redirecting to https://github.com/oneeyeman1/dbhandler.git/
warning: Cannot merge binary files: dbhandler.xcodeproj/project.xcworkspace/xcuserdata/igorkorot.xcuserdatad/UserInterfaceState.xcuserstate (HEAD vs. 99e3237b1e5ece37e624a4ca1c78d739c97e79df)
Auto-merging dbhandler.xcodeproj/project.xcworkspace/xcuserdata/igorkorot.xcuserdatad/UserInterfaceState.xcuserstate
CONFLICT (content): Merge conflict in dbhandler.xcodeproj/project.xcworkspace/xcuserdata/igorkorot.xcuserdatad/UserInterfaceState.xcuserstate
Automatic merge failed; fix conflicts and then commit the result.

这个文件需要在VC中吗?我最初的想法是将所有内容都放在 VC 中,但结果 Xcode 项目文件也包含二进制文件。而且我不太熟悉 Xcode 内部结构。

【问题讨论】:

    标签: xcode git


    【解决方案1】:

    检查将二进制合并添加到xcuserstate 文件是否有帮助:

    echo '*.xcuserstate  binary merge' >> .gitattributes
    
    • binary 将保留隐含的 -text(删除 crlf)和 -diff(无差异),
    • merge 允许合并文件。

    有关文档,请参阅“using macro attributes”,有关实际示例,请参阅“gitattributes and the binary option”。

    但是,更一般地说,such files do not need to be in source control(如stated here)。
    你可以看到here what they represent
    你可以remove them and ignore them(最好是git rm with the --cached option)。

    【讨论】:

    • 我会尝试,但更大的问题是文件是否应该在 VC 下。
    • @Igor 对!我错过了你问题的那一部分。我已经相应地更新了我的答案。
    • 我排除了这些文件,一切似乎仍在工作。谢谢。
    猜你喜欢
    • 2011-03-07
    • 2015-10-31
    • 1970-01-01
    • 2017-03-10
    • 2012-08-30
    • 2021-03-25
    • 2018-02-20
    • 2015-03-30
    • 2010-09-06
    相关资源
    最近更新 更多