Skip to content

Instantly share code, notes, and snippets.

@loncarales
Last active July 7, 2020 11:35
Show Gist options
  • Select an option

  • Save loncarales/7c91cdabdec32485931fa085a16c7089 to your computer and use it in GitHub Desktop.

Select an option

Save loncarales/7c91cdabdec32485931fa085a16c7089 to your computer and use it in GitHub Desktop.
Git for Windows: Set up Helix Visual Merge Tool (P4Merge) as default mergetool
[merge]
keepBackup = false
tool = p4merge
[mergetool]
prompt = false
[mergetool "p4merge"]
cmd = p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
[difftool]
prompt = false
[difftool "p4merge"]
cmd = p4merge \"$LOCAL\" \"$REMOTE\"
keepTemporaries = false
trustExitCode = false
keepBackup = false

Open git-bash and type

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd "p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""
git config --global mergetool.p4merge.trustExitCode false
git config --global mergetool.keepBackup false
git config --global diff.tool p4merge
git config --global difftool.p4merge.cmd "p4merge \"$LOCAL\" \"$REMOTE\""

The .gitconfig should look like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment