Using WinMerge as your Git diff and merge tool lets you resolve conflicts visually instead of wrestling with text-based conflict markers. Here's how to configure it.

Step 1: Find Your WinMerge Path

By default, WinMerge installs to:

C:\Program Files\WinMerge\WinMergeU.exe

Confirm this path exists before editing your Git config.

Step 2: Edit Your .gitconfig

Open your global Git config file (~/.gitconfig) and add the following:

[diff] tool = winmerge [difftool "winmerge"] cmd = \"C:/Program Files/WinMerge/WinMergeU.exe\" -e -u \"$LOCAL\" \"$REMOTE\" [merge] tool = winmerge [mergetool "winmerge"] cmd = \"C:/Program Files/WinMerge/WinMergeU.exe\" -e -u -dl \"Local\" -dr \"Remote\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\" trustExitCode = true

Step 3: Use WinMerge from Git

Now you can open diffs and resolve merges visually:

# Open diff in WinMerge git difftool filename.txt # Resolve merge conflicts in WinMerge git mergetool

💡 Tip: Add keepBackup = false under [mergetool] to prevent Git from creating .orig backup files after merging.

3-Way Merge in WinMerge

When WinMerge opens as a merge tool, it shows three panes: Local (your branch), Remote (incoming branch), and Merged (the output file). Review conflicts in each pane, choose which changes to keep, and save the merged file to complete the conflict resolution.