Beautify Git Diffs
Though Git colorizes the diff outputs, it’s still not easy to recognize exactly what’s changed in a line. Please have a look at the following screenshot:
Though there are only a few characters of changes, it appears like the whole line is removed and added in a different shape.
Anyways... If you wanna make a better git diff view, you can use some external tools like https://github.com/dandavison/delta Git-delta creates a really awesome view like the following one which is easy to read.
How To Install Git-Delta
Mac
You can use the following homebrew formula to install git-delta
$ brew install git-delta
Ubuntu
- Download the suitable package for you accordingly to your CPU architecture from the release page
https://github.com/dandavison/delta/releases - Install the package like any other Debian package.
$ sudo dpkg -i <the package name>.deb
Other Operating Systems:
Please visit https://dandavison.github.io/delta/installation.html
How To Configure Git-Delta
You can configure it simply like the following one or, review more options from https://dandavison.github.io/delta/configuration.html
$ git config --global core.pager delta$ git config --global interactive.diffFilter ‘delta --color-only’$ git config --global diff.colorMoved default