Beautiful git diff


You need to show a beautiful git diff to your friend. You can use git diff and git diff --color-words to show the diff. But, it is not beautiful enough. You can use delta to make it more beautiful.

Install delta

brew install git-delta

See the delta for other installation methods.

Configure git to use delta

Add these to your ~/.gitconfig file.

# git-delta
# to show beautiful diff
[core]
    pager = delta # comment this line if you don't want to use anymore

[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)
    side-by-side = true
    line-numbers = true

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default

Result

Here is the result of the diff.

Alt text