ydluzg

Better git diff

git

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



4 Responses
Add your response

4515
5757771770a152302b03f8e78c7b105a
over 1 year ago ·
6602
Cezar1

For those who need to review patch files, you can use this tool to highlight the differenced if you provide the --color option when you save your diff.

git --no-pager diff --color HEAD..master > your.diff

over 1 year ago ·
16068

Having a little problem with those screenshots, as per http://blog.canonical.com/2014/04/02/shutting-down-ubuntu-one-file-services/

over 1 year ago ·
16077
5ccede21916d526709a9b0ec64352aa3
over 1 year ago ·