Since I am currently doing a lot of work from home, I have started optimizing my local setup a little to make my daily work more comfortable. That includes the command-line tools I use every day. GIT is one of them.
One thing that always annoyed me was that the comparison view was not quite ideal.
Fortunately, GIT comes not only with a diff command, but also with the "difftool" command, which allows you to integrate an external diff tool. Since I prefer working in the console, I integrated icdiff.
I simply added the following to my ~/.gitconfig.
[diff] tool = icdiff [difftool] prompt = false [difftool "icdiff"] cmd = /usr/bin/icdiff --line-numbers $LOCAL $REMOTE
It is also possible to integrate other diff tools, such as PhpStorm, meld, or colordiff.
You can then run it from the command line like this, for example:
git difftool HEAD~1