Skip to content

Instantly share code, notes, and snippets.

@GameScripting
Created December 10, 2013 15:56
Show Gist options
  • Select an option

  • Save GameScripting/7892948 to your computer and use it in GitHub Desktop.

Select an option

Save GameScripting/7892948 to your computer and use it in GitHub Desktop.
Better git diffs using the diff-highlight script Source: https://coderwall.com/p/ydluzg

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment