Default git

The default git diff is rather lackluster since it only displays which lines changed, not _how _they changed:

Image for post

Git diff, default

This is especially bad when the lines are long, or there are a lot of very similar lines:

Image for post

Long lines and repetition with default diff

One solution is looking at diffs using GitHub or GitLab, both of which highlight the specific words that changed. This is a lot nicer, but it obviously doesn’t run in the terminal, requires you to be online, and only works with repos that are hosted on the website (and up to date).

#command-line #git #diff

Improving Git Diffs
1.35 GEEK