simonwagner / mergepbx

script for merging XCode project files in git
GNU General Public License v3.0
1.04k stars 45 forks source link

Unknown merge tool after installing with brew #31

Open GammaCodeX opened 5 years ago

GammaCodeX commented 5 years ago

Hi

I've installed mergepbx via brew brew install mergepbx and tried to use it to merge a .pbxproj file with git mergetool --tool=mergepbx something.xcodeproj/project.pbxproj but git gives the output

Merging:
something.xcodeproj/project.pbxproj

Normal merge conflict for 'something.xcodeproj/project.pbxproj':
  {local}: modified file
  {remote}: modified file
Unknown merge tool mergepbx

However running mergepbx barewords gives the expected mergepbx: error: too few arguments along with the usage: message. which mergepbx reveals it is located in /usr/local/bin/mergepbx but using the entire path for --tool= still gives the unknown merge tool.

Adding the lines from the README to .gitattributes and .gitconfig did not change this

How do I proceed? I would have hoped brew would have informed me if there was a caveat to installing using homebrew...

dustinrwh commented 5 years ago

You probably need to add mergepbx as a merge tool to your git configuration. It's in the README, but some of the tutorials online miss this step.

All you should have to do is add the following to ~/.gitconfig (which you can create if you don't have one):

#driver for merging Xcode project files
[mergetool "mergepbx"]
    cmd = mergepbx "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"