1

When I do git status now, I get this as part of the results

#   both modified:      BusinessPlan.xcodeproj/project.pbxproj

This is kind of an important file because Apple's xCode uses it to open the whole project. I am not even sure it should be in git. Should it?

How can I resolve this? Should this file not be committed? I think I might have gotten changes from other developers. How can I clean it up and what is the way to work with this kind of a file long-term?

Thanks!

Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40
Genadinik
  • 18,153
  • 63
  • 185
  • 284

2 Answers2

2

Yes, I am afraid you have to merge this file. In fact, in the most case, it can be done correctly and automatically. You don't need to merge it yourself.

ps: about strategy of using git for iOS project, there is quite a lot discussion exist. Google something like iOS gitignore, than you can find link1 or link2, etc ...

Community
  • 1
  • 1
swang
  • 250
  • 1
  • 11
-3

In order to get Git and Xcode to play together nicely, you need to tell Git to ignore a handful of the extraneous files Xcode uses.

Create a file called .gitignore in the root folder of your project, and include this text:

# files created by Xcode 3 or older
*.pbxuser
*.mode1
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcclassmodel/
# files created by Xcode 4
xcuserdata/
# build products
*.build/
build/
DerivedData/
# Misc
.svn
.DS_Store

This will instruct Git to ignore all of the files that will cause problems.

Taken from Beanstalk page on Setting up Git with XCode 4.

Axeva
  • 4,697
  • 6
  • 40
  • 64
  • 1
    Downvoted this answer: `*.xcodeproj/project.pbxproj` is not in the `.gitignore` file, and this file definitely should not be ignored by `git`. – derpoliuk Dec 23 '13 at 12:43
  • I have had success with https://github.com/simonwagner/mergepbx for merging the project file. – weibel Apr 15 '14 at 11:48