Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 943
Helen Wood Avatar asked Jul 21 '15 14:07

Helen Wood


People also ask

How do I resolve merge conflicts in Mergetool Git?

Concepts for resolving Git conflictsREMOTE - the head for files(s) from a remote location that you are trying to merge into your LOCAL branch. BASE - the common ancestor(s) of LOCAL and REMOTE . MERGED - the tag / HEAD object after the merge - this is saved as a new commit.


2 Answers

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.

like image 62
Josh Brown Avatar answered Sep 22 '22 03:09

Josh Brown


  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
like image 33
skingtree Avatar answered Sep 20 '22 03:09

skingtree