Reference Source: Http://coding4streetcred.com/blog/post/Configure-DiffMerge-for-Your-Git-DiffTool
Main transfer from: http://blog.csdn.net/u010232305/article/details/51767887
1. Download Diffmerge
http://sourcegear.com/diffmerge/downloads.php, the landlord chose Windows Installer (64bit), installation directly next, this version can only be installed on the C drive
2. Create a startup Diffmerge script(1) Create the following two scripts under the \cmd path of the git installation path
git-difftool-diffmerge-wrapper.sh content is
1# Place thisfile inchThe Windows Git installation directory/cmd folder2# Be sure to add the. /cmd folder to the PATH environment variable3 4#diffis called by Git with7Parameters:5# path old-fileOld-hex Old-mode new-fileNew-hex new-Mode6 7 "C:\Program Files\sourcegear\common\diffmerge\sgdm.exe" " $" " $"|Cat
git-mergetool-diffmerge-wrapper.sh content is
1# Place thisfile inchThe Windows Git installation directory/cmd folder2# Be sure to add the. /cmd folder to the PATH environment variable3 4 # passing the following parameters to Mergetool:5 # local base remote Merge_result6 7 "C:\Program Files\sourcegear\common\diffmerge\sgdm.exe"" $"" $"" $"--result="$4"--title1="Mine"--title2="Merge"--title3="Theirs"
Note: The path name is the actual pathname of the installed DiffMerge.exe, and the landlord is "C:/Program Files/sourcegear/common/diffmerge/sgdm.exe"
(2) Set the \CMD environment variable, easy to find
The Git program's cmd directory is added to the environment variable path, the landlord's "C:\Program Files\git\cmd"
3. Modify the Git configuration
Locate the. gitconfig file (path under Windows user path)
Upsert the following content:
1 [Merge]2Tool =Diffmerge3[diff]4Tool =Diffmerge5 [Mergetool]6Keepbackup =false7[Mergetool"Diffmerge"]8cmd = Git-mergetool-diffmerge-wrapper.SH "$LOCAL" "$BASE" "$REMOTE" "$MERGED"9[Difftool"Diffmerge"]Tencmd = Git-difftool-diffmerge-wrapper.SH "$LOCAL" "$REMOTE"
4. OK
When the merge conflict occurs, enter
git mergetool
Diffmerge's out.
Git configures diff and the merge tool---diffmerge in a Windows environment