版本控制中的Xcode项目文件

时间:2018-11-16 04:42:52

标签: xcode git

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

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的内部原理。

1 个答案:

答案 0 :(得分: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)。