Setup: git difftool & mergetool

The git diff command prints changes to stdout, normally to the terminal screen.

Set up a visual diff and merge program for use with git difftool and git mergetool.

Changes in binary files do not show well in common diff tools and can take a long time for them to compute visual diffs.

This is easily avoided using the -d option: git difftool -d

This shows all changed files in the diff program, and you can view and skip files there as appropriate.

Linux example


Linux meld

gedit ~/.gitconfig


tool = meld


prompt = false

[difftool "meld"]

cmd = meld "$LOCAL" "$REMOTE"


tool = meld

[mergetool "meld"]

cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"