Improved Colour Diff or icdiff gives you nice github style diffs in the terminal. It does work well, however getting it to work with git smoothly was a little fiddly so I thought I would share. Just add this to your ~/.gitconfig
.
[alias]
showtool = "!f() { git difftool $1^ $1; }; f"
added = difftool --cached
[diff]
tool = icdiff
[difftool]
prompt = false
[difftool "icdiff"]
cmd = /usr/bin/icdiff --line-numbers $LOCAL $REMOTE
[pager]
difftool = true
This lets your run git difftool
to view your current unstaged changes, and view commits with git showtool <commit>
.
If you are used to working with github, this is quite a nice feature as you don't have to adjust your eyes when reviewing a PR, or looking at your local changes.
:wq