

This file should be in your home directory in C:\Users\UserName: Ĭmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"Ĭmd = C:/Program\\ Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"įor IntelliJ IDEA (Community Edition) 3-way git mergetool configuration in Windows environment ( ~/.gitconfig)Ĭmd = C:/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe merge `cygpath -wa $LOCAL` `cygpath -wa $REMOTE` `cygpath -wa $BASE` `cygpath -wa $MERGED`Ĭmd = "/c/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 14.1.3/bin/idea.exe" merge `~/winpath.sh $LOCAL` `~/winpath.sh $REMOTE` `~/winpath.sh $BASE` `~/winpath.sh $MERGED` Git config -global 'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"'Īdd the following lines to your. Git config -global 'C:/Program\ Files/SourceGear/Common/DiffMerge/sgdm.exe \"$LOCAL\" \"$REMOTE\"' gitconfig to configure GIT use DiffMerge: git config -global diff.tool diffmerge
Set up p4merge update#
The following commands in a Command Prompt window will update your. I found two ways to configure " SourceGear DiffMerge" as difftool and mergetool in github Windows. The p4merge tool from Perforce is a pretty good standalone merge tool. Once you've setup your favourite merge tool, it's simply a matter of running git mergetool whenever you have conflicts to resolve. Git config 'mymerge.exe -base "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"' Something like this should give the flavour of what you can do ('mymerge' is a fictional tool). You have to be a bit careful with the escaping whether you directly edit a config file or set the variable with the git config command. Otherwise, you can set mergetool.cmd to a bit of shell to be eval'ed at runtime with the shell variables $BASE, $LOCAL, $REMOTE, $MERGED set to the appropriate files.
Set up p4merge full#
If the merge tool is one of the ones supported natively by it you just have to set mergetool.path to the full path to the tool (replace by what you have configured merge.tool to be.

In brief, you can set a default mergetool by setting the user config variable merge.tool. Git mergetool is fully configurable so you can pretty much chose your favourite tool.
Set up p4merge how to#
$LOCALAPPDATA/Perforce/p4merge.exe), git does not seem to be expanding environment variables for paths (if you know how to get this working, please let me know or update this answer)


The changes (relative to Charles Bailey): Or, from a windows cmd.exe shell, the second line becomes : git config -global "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"" To follow-up on Charles Bailey's answer, here's my git setup that's using p4merge (free cross-platform 3way merge tool) tested on msys Git (Windows) install: git config -global merge.tool p4merge
