Merge conflicts with project.pbxproj on Git - Xcode iOS

Although I already read similar comments here, in this forum I did not find an approach that might be suitable for working together in a seamless manner.

If you know what I mean, you can already find the complex work with git and project.pbxproj files in Xcode, even if you are working in another file.

Let's say

  • Developer: created the Foo folder by adding foo.swift to the project.
  • B Developer: The Bar folder is created by adding bar.swift to the project.

Different ways ... but you know the conflict! And, as you may have noticed, shutting down project.pbxproj not an option.

So my question is: how do you handle this professionally, git thread is ready and easiest.

Thank you very much.

PS: I am currently using Bitbucket and SourceTree, if that matters.

PS2: I would like, if possible, to avoid the command line and manually editing files.

+7
git git-merge atlassian-sourcetree ios xcode
source share
2 answers

Create a .gitattributes file and add the following line:

*.pbxproj merge=union

Mergers will occur automatically and without having to touch anything.

Alternatively, you can try mergepbx , which makes for more intelligent merging.

+5
source share
  • New files are created by only one developer in the "main-develop" branch.
  • Click new files on "main-develop"
  • These files are implemented by other developers after clicking
+1
source share

All Articles