Git supports external diff
GIT_EXTERNAL_DIFF for a one-off git command.
$ GIT_EXTERNAL_DIFF=difft git diff $ GIT_EXTERNAL_DIFF=difft git log -p --ext-diff $ GIT_EXTERNAL_DIFF=difft git show e96a7241760319 --ext-diff
If you want to use difftastic by default, use
# Set git configuration for the current repository. $ git config diff.external difft # Set git configuration for all repositories. $ git config --global diff.external difft
git diff will use
automatically. Other git commands require
--ext-diff to use
$ git diff $ git log -p --ext-diff $ git show e96a7241760319 --ext-diff
git difftool is a git command for viewing the current changes with a different diff tool. It's useful if you want to use difftastic occasionally.
following to your
.gitconfig to use difftastic as your difftool.
[diff] tool = difftastic [difftool] prompt = false [difftool "difftastic"] cmd = difft "$LOCAL" "$REMOTE"
You can then run
git difftool to see current changes with difftastic.
$ git difftool
We also recommend the following settings to get the best difftool experience.
# Use a pager for large output, just like other git commands. [pager] difftool = true # `git dft` is less to type than `git difftool`. [alias] dft = difftool