Skip to content

Instantly share code, notes, and snippets.

@ProGM
Created March 29, 2016 10:01
Show Gist options
  • Save ProGM/f06d78e17ae80b6eac02 to your computer and use it in GitHub Desktop.
Save ProGM/f06d78e17ae80b6eac02 to your computer and use it in GitHub Desktop.
A script to run git-diff per character/words.
#!/usr/bin/env bash
if [[ $1 == 'words' ]]; then
git diff --color-words="[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+"
elif [[ $1 == 'nospace' ]]; then
git diff --color-words=.
else
git diff --color-words
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment