Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created May 23, 2011 13:34
Show Gist options
  • Save karlwestin/986695 to your computer and use it in GitHub Desktop.
Save karlwestin/986695 to your computer and use it in GitHub Desktop.
Make git diff ignore whitespace and don't try to open jpgs and shit
# this can be put in [repo]/.git/config for local settings
# or ~/.gitconfig for global settings
# create a difftool "nodiff" that just returns true
# this path is for Mac. On linux it's /bin/true i guess
[diff "nodiff"]
command = /usr/bin/true
# make git ignore white space differences, many different possibilites here
# check http://www.kernel.org/pub/software/scm/git/docs/git-config.html#_variables
[core]
whitespace = -trailing-space,-indent-with-non-tab,-tab-in-indent
# place this text in [repo]/.git/info/attributes
# image files
*.png diff=nodiff
*.jpg diff=nodiff
*.gif diff=nodiff
# webfonts
*.ttf diff=nodiff
*.woff diff=nodiff
*.eot diff=nodiff
*.svg diff=nodiff
#flash
*.swf diff=nodiff
*.fla diff=nodiff
# movie files
*.m4v diff=nodiff
*.flv diff=nodiff
*.ogv diff=nodiff
*.webm diff=nodiff
*.mp4 diff=nodiff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment