Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active February 24, 2017 11:39
Show Gist options
  • Save mcandre/e98d0274a79c9a730f74 to your computer and use it in GitHub Desktop.
Save mcandre/e98d0274a79c9a730f74 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