1

I'm currently using Xcode with Git, and I'm experiencing some troubles during the merge process of my xcodeproj.

Developer1 create a new group in Xcode file arborescence the commit and push. Developer2 on an other computer do the same with an other group name, commit and pull(with merge).

The xcodeproj of Developer 2 become unreadable with Xcode.

But when I create a new file or just drag and drop files from finder to repository, the merge succeed.

Did someone has experienced that kind of trouble?

I'm using in .gitattributes:

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

and in my .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
\#*#
.#*

1 Answers1

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @user1473113 no alternative that I can think of. The idea would to check why Dev2 project becomes unreadable (by taking a copy of the project *before* pulling, and comparing with the same project after the pull). – VonC Oct 04 '12 at 14:23
  • I found the xcworkspace file, removed it and when i launch the project with Xcode that say me the same: "**P66.xcodeproj cannot be opened because the project file cannot be parsed**" – user1473113 Oct 04 '12 at 14:33
  • @user1473113 did you check the content of that file `P66.xcodeproj`? Is there any merge conflict markers left (like `<<<<<<` or `>>>>>>`)? See https://lindsay.cpsc.ucalgary.ca/q&a/165/omija-xcodeproject-anymore-perform-clean-build-suggestions#a166 or, for illustration: http://stackoverflow.com/questions/1496182/user-file-cannot-be-parsed-in-subversion-in-mac-iphone-sdk – VonC Oct 04 '12 at 14:47
  • @user1473113 Check also if you don't have any space in the project name (https://bugzilla.xamarin.com/show_bug.cgi?id=3658#c2 after http://stackoverflow.com/questions/9479954/monotouch-xcodeproj-cannot-be-opened-because-the-project-file-cannot-be-parsed) – VonC Oct 04 '12 at 14:51
  • @user1473113 other alternatives/workaround: http://stackoverflow.com/a/361859/6309 – VonC Oct 04 '12 at 14:52
  • There is no conflict markers because of the "*.pbxproj -crlf -diff merge=union", no space in the project name. – user1473113 Oct 04 '12 at 20:43
  • @user1473113 ok, I was trying to cover all the cases here. – VonC Oct 04 '12 at 20:44