Where developers come to connect, share, build and be inspired.

14

Better git diff

2025 views

When an old line and a new line are very similar, it's hard to immediately see the difference, so highlighting the changed parts might help.

What you need to do are just downloading a perl script and configuring your git.

$ curl -O https://raw.github.com/git/git/master/contrib/diff-highlight/diff-highlight

Move the file diff-highlight to the ~/bin/ directory (or wherever your $PATH is), and then add the following to your ~/.gitconfig

[pager]
        log = diff-highlight | less
        show = diff-highlight | less
        diff = diff-highlight | less

Here are a few screenshots that show you how it looks like

Comments

Add a comment