简体   繁体   中英

Merge conflicts with project.pbxproj on Git - Xcode iOS

Although I already read similar comments here, in this forum, I haven't found an approach that may be suitable for teamwork in a seamless way.

If you know what I mean, you already may found tricky working with git and the project.pbxproj file in Xcode, even when you are working in a different file.

Say,

  • A developer: created Foo folder, adding foo.swift to the project.
  • B developer: created Bar folder, adding bar.swift to the project.

Different paths... but you know, conflict! And as you may also noticed, leaving project.pbxproj out is not an option.

So my question is: How do you handle this in a professional manner, Git flow ready and easiest way.

Thank you all very much.

PS: I'm using currently Bitbucket and SourceTree if matters.

PS2: I'd like to avoid command line and manually file editing if possible.

Create a .gitattributes file and adding the following line:

*.pbxproj merge=union

Merges will happen automatically and without you having to touch anything.

Alternatively, you might try mergepbx , which does a more intelligent merge.

  1. New files are created by only one developer on "main-develop" branch.
  2. Push new files to "main-develop"
  3. Those files are implemented by other developers after pull

I'm one of the maintainers of Kintsugi , a tool that intelligently merges the conflicts and promises to automatically solve 99.9% of the conflicts that occur in project.pbxproj files.

The readme also contains instructions on how to set it up as Git merge driver, so it will be applied automatically whenever a conflict in a *.pbxproj file occurs. I don't know of a way to do that from Sourcetree, but for most conflicts after setup you won't have to touch the command line again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM