1

我目前正在将 Xcode 与 Git 一起使用,并且在xcodeproj的合并过程中遇到了一些麻烦。

Developer1 在 Xcode 文件中创建一个新组来树状提交和推送。另一台计算机上的 Developer2 对其他组名执行相同的操作,提交和拉取(合并)。

Developer 2 的 xcodeproj 变得无法使用 Xcode 读取。

但是当我创建一个新文件或只是将文件从 finder 拖放到存储库时,合并成功。

有没有人遇到过这样的麻烦?

我在 .gitattributes 中使用:

*.pbxproj -crlf -diff merge=union
# Better to treat them as binary files.
*.pbxuser -crlf -diff -merge
*.xib -crlf -diff -merge

在我的 .gitignore

# Mac OS X
*.DS_Store
*~

# Xcode
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/

*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/*.pbxuser

# Generated files
*.o
*.pyc
*.hi

#Python modules
MANIFEST
dist/
build/

# Backup files
*~.nib
\#*#
.#*
4

1 回答 1

0

Adding a new file isn't the same as adding a new group.
A group is also registered in the project.xcworkspace file (see "Undo “New group from selection” project xcode 4"), and it is possible the merge put that file at odd with the merged project.pbxproj file.
Check if closing XCode, removing project.xcworkspace and re-opening XCode doesn't fix the "readibility" issue for Dev2.

If that doesn't solve it, then he/she will need to isolate the changes introduced by Dev1 and apply them manually.

于 2012-10-04T06:14:27.520 回答