Skip to content

Instantly share code, notes, and snippets.

@DoomyTheFroomy
Forked from mcandre/git-setup-gui-mergetool.md
Last active August 29, 2015 14:28
Show Gist options
  • Save DoomyTheFroomy/36245b4caad8e22aecd4 to your computer and use it in GitHub Desktop.
Save DoomyTheFroomy/36245b4caad8e22aecd4 to your computer and use it in GitHub Desktop.

Install Xcode.

http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12

Enable opendiff

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Configure git to use opendiff for merging

$ git config --global merge.tool opendiff

Launch opendiff during a git merge conflict

$ git mergetool

screenshot

Use hotkeys for speed

Left/Right arrow keys: Select left/right side of a conflict

Up/Down arrow keys: navigate between conflicts

Command+s: Save file

Command+q: Quit file. git will automatically launch opendiff again for any other files with conflicts.

Finish merge

$ git add .
$ git commit
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment