Better git diffs in your terminal

Better git diffs in your terminal
Photo by Possessed Photography / Unsplash

git diff is an essential tool, almost required in your daily duties, but, the default view is not friendly in first instance it looks cryptic:

So, why not change it and use a more friendly view, git supports different pagers to do that, here I will recommend you delta pager you could install it from any Linux distribution main repositories, in arch you could find it as git-delta

so install it in arch is easy with:

sudo pacman -S git-delta

once installed you should update your ~/.gitconfig, adding the following lines:

[core]
    pager = delta
[interactive]
    diffFilter = delta --color-only
[delta]
    navigate = true    # use n and N to move between diff sections
    light = false      # set to true if you're in a terminal w/ a light background color (e.g. the default macOS terminal)
[merge]
    conflictstyle = diff3
[diff]
    colorMoved = default

once done you should be able to see a nice diff view now:

here the link to git-delta github page, enjoy!!