Modifying .gitconfig to use the Merge Tool on Mac

Git on Mac populates the values for the ${VAR} variables with the relative paths, whereas on Windows they are populated by the absolute path.

This behavior can sometimes lead to confusion when working with Git and certain aspects of Storyboard development.

Take the Merge Tool for example. This tool allows you to integrate the Storyboard Comparator into your Git workflow, even at an integration infrastructure level. If you are unfamiliar with this tool you can read more about it here: Integrating Storyboard Comparator into GIT

In order to set up the tool you have to modify your .gitconfig file in order to point to the Storyboard Comparator for merges. An example for this on Mac might look like:

[mergetool "mergegdetool"]
cmd = /Applications/Crank_Software_7.1/Storyboard_Comparator/StoryboardComparator.app/Contents/MacOS/StoryboardComparator
-nosplash -headless -output=$MERGED $BASE $LOCAL $REMOTE

While the equivalent command on Windows would work just fine, on Mac you might find that the placeholder variables populated by Git (BASE, LOCAL, REMOTE) are relative to the present working directory. 

In order to get it to work as expected you will have to manually convert it to the absolute path with the use of pwd. This might look like:

[mergetool "mergegdetool"]
cmd = /Applications/Crank_Software_7.1/Storyboard_Comparator/StoryboardComparator.app/Contents/MacOS/StoryboardComparator
-nosplash -headless -output=`pwd`/$MERGED `pwd`/$BASE `pwd`/$LOCAL `pwd`/$REMOTE

If you’ve been encountering the issue as described above then give specifying pwd a try.

0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post