6

Everytime I do a pull, there is a merge conflict from my other team member.. And I've tried to manually remove the ==== and >>>>'s but Xcode will never open the file after this.

I am just curious, is this a problem that EVERY iOS person on a team deals with? Is there any sort of tip or trick to avoid this nonsense? It's seriously slowing down my productivity by a huge amount.

patrick
  • 9,290
  • 13
  • 61
  • 112
  • 1
    Consider adding the SCM tool used (SVN? Git? Other?), in any case: http://stackoverflow.com/questions/2004135/how-to-merge-conflicts-file-project-pbxproj-in-xcode-use-svn?rq=1 , http://stackoverflow.com/questions/7481563/xcode-project-file-pbxproj-how-to-handle-it-in-version-control?rq=1 –  Aug 16 '12 at 03:45
  • Try out the `merge=union` option: https://twitter.com/zholmquist/status/172824285562408961 It works well for a lot of people a lot of the time. See also http://stackoverflow.com/questions/2729109/should-i-merge-pbxproj-files-with-git-using-merge-union – rob mayoff Aug 16 '12 at 04:02

3 Answers3

3

You just need a good merge tool. I use p4merge: http://www.andymcintosh.com/?p=33 contains a guide to integrating it with Git.

borrrden
  • 33,256
  • 8
  • 74
  • 109
  • I only use Hg, but kdiff3 has generally treated me well .. so might be something else to look into. Also, [this (closed) post](http://stackoverflow.com/questions/96051/best-file-comparison-tool) contains additional merge-tool suggestions (not sure which apply to OS X). –  Aug 16 '12 at 03:40
1

these two can go a long way:

  • rely on the xcode project less, such that you could reconstruct a project by adding a directory of stuff, then get it to build with minimal changes. a good example of this: define your build settings in xcconfigs.

  • simplify your projects. collisions will be reduced if you are developing separate components of the same larger project.

justin
  • 104,054
  • 14
  • 179
  • 226
  • @MattH. the basic starting point is to divide projects into separate components. somebody new to xcode or sw development might just stuff everything in one target. however, your program's backend might be better off in a static library target, which is configured as a dependency of your main app and belongs to a separate target in a separate xcode project. then you might put your unit tests in separate projects -- you just break things apart in smaller pieces. collisions are less likely because then you have a structured graph of many components rather than a monolithic project for everything. – justin Jan 20 '13 at 11:28
0

I ran into a merge conflict that had to do with our team's cocoapods integration. After running pod deintegrate and then pod install again the .pbxproj file was parsable again.