Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@soffes

This comment has been minimized.

Copy link

soffes commented Aug 19, 2015

👍

@intel352

This comment has been minimized.

Copy link

intel352 commented Oct 5, 2015

@kylefox, I actually have a binary existing at /usr/bin/opendiff already, which is not a symlink, and last modified date shows it to be physically older than the version at /Applications/Xcode.app/Contents/Developer/usr/bin/opendiff. So using the git line that you have, seems that would find the version that is specified at /usr/bin/opendiff, rather than the xcode version, right? Or does the app itself then refer back to Xcode for the proper location to open?

@alanwill

This comment has been minimized.

Copy link

alanwill commented Oct 21, 2015

@intel352 per the opendiff man page:

opendiff is a command line utility that provides a convenient way to launch the FileMerge application from Terminal to graphically compare files or directories. If FileMerge is already running, opendiff will connect to that running instance for the new comparison. opendiff exits immediately after the comparison request has been sent to FileMerge.

@connorbode

This comment has been minimized.

Copy link

connorbode commented Feb 1, 2016

thx

@k7n4n5t3w4rt

This comment has been minimized.

Copy link

k7n4n5t3w4rt commented Mar 1, 2016

phew. thanks. vimdiff was killing me.

@KokoDoko

This comment has been minimized.

Copy link

KokoDoko commented Mar 18, 2016

Am I correct that I still have to open the tool manually by typing "git mergetool" after a merge conflict? Or should this happen automatically?

@tooluser

This comment has been minimized.

Copy link

tooluser commented May 6, 2016

You are correct KokoDoko.

@ndstephens

This comment has been minimized.

Copy link

ndstephens commented Mar 1, 2017

thank you. exactly what i was looking for

@ghost

This comment has been minimized.

Copy link

ghost commented Aug 22, 2018

Fantastic, thank you!

@domoench

This comment has been minimized.

Copy link

domoench commented Jun 10, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.