Skip to content

Instantly share code, notes, and snippets.

@richimf
Last active April 17, 2020 17:30
Show Gist options
  • Save richimf/67d605c3b237268944a24be6dcc2be32 to your computer and use it in GitHub Desktop.
Save richimf/67d605c3b237268944a24be6dcc2be32 to your computer and use it in GitHub Desktop.
Avoid merge conflicts into project.pbxproj
  1. Create a .gitattributes file:

Assuming you don’t already have one, create a file called .gitattributes in your project’s root directory.

  1. Set the merge strategy to union:

Add the following line to your .gitattributes file.

This will tell git to merge using the union strategy, meaning it’ll keep both sides (theirs and ours).

*.pbxproj merge=union

As an alternative:

Check this library, this allows you to add a similar attribute.

*.pbxproj merge=mergepbx

  1. Add it to your project:

git add .gitattributes

Reference:

https://roadfiresoftware.com/2015/09/automatically-resolving-git-merge-conflicts-in-xcodes-project-pbxproj/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment