Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
git mergetool config (by command line or .gitconfig)
[merge]
tool = intellij
# tool = Kaleidoscope
[diff]
tool = intellij
# tool = Kaleidoscope
# intellij mergetool config
[mergetool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\ 13\\ CE.app/Contents/MacOS/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[difftool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\ 13\\ CE.app/Contents/MacOS/idea diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
# Kaleidoscope for merge tool
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
# use intellij as your merge tool
git config --global mergetool.intellij.cmd '/Applications/IntelliJ\ IDEA\ 13\ CE.app/Contents/MacOS/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")'
git config --global mergetool.intellij.trustExitCode false
git config --global merge.tool intellij
git mergetool -y
# use sourcetree as your merge tool
git config --global mergetool.sourcetree.cmd "sourcetree \$LOCAL \$REMOTE"
git config --global mergetool.sourcetree.trustExitCode false
git config --global merge.tool sourcetree
git mergetool -y
# use Sublime as your merge tool
git config --global mergetool.sublime.cmd "subl -w \$LOCAL \$REMOTE"
git config --global mergetool.sublime.trustExitCode false
git config --global merge.tool sublime
git mergetool -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment