This document discusses resolving conflicts that occur when merging Xcode projects managed with Git. It explains that Xcode-generated *.pbxproj files often cause opaque conflicts. Two approaches are presented: using Git to automatically merge the files or using Xcode to manually resolve them. The recommended approach is to clear the Xcode project structure, use Git to check out changes with higher priority, and drag folders back into Xcode to rebuild the project files. Creating automation scripts could further improve resolving these merge conflicts.
23. Fixing using Xcode?
• Clear project structure
• Pick higher priority changes using git checkout --theirs /
--ours
24. Deciding change priority on *.pbxproj
• Prioritize changes on build settings (build number, post build script,
framework, etc.)
• On file changes, always pick other people’s changes over ours.
25. Deciding change priority on *.pbxproj
👩 👱
Anna’s changes:
- Bumped build number
- Changed provisioning profile
Bob’s changes:
- Added new files
26. Deciding change priority on *.pbxproj
👩 👱
Anna’s changes:
- Bumped build number
- Changed provisioning profile
Bob’s changes:
- Added new files
Higher priority
27. Deciding change priority on *.pbxproj
(As Bob)
👩 👱
Anna’s changes:
- Bumped build number
- Changed provisioning profile
Bob’s changes:
- Added new files
Pick the other branch (git checkout --theirs *.pbxproj)
28. Deciding change priority on *.pbxproj
(As Anna)
👩 👱
Anna’s changes:
- Bumped build number
- Changed provisioning profile
Bob’s changes:
- Added new files
Pick the her own branch (git checkout --ours *.pbxproj)
29. Fixing using Xcode?
• Clear project folder structure
• Pick higher priority changes using git checkout --theirs /
--ours
• Drag and drop folder to Xcode as groups
30. How to fix this?
• Famous last words: “I’ll do it manually.” 💀
• Let Git fix it. ❌
• Let Xcode fix it. ✅
31. How to improve?
• Make script / app to automate Xcode’s *.pbxproj update process
to replace drag-and-drop step
• Using folder references for prevent drag-and-drop (?)
32. Further reading
• Vincent Driessen’s successful Git branching model (http://nvie.com/
posts/a-successful-git-branching-model/)