Skip to content

Instantly share code, notes, and snippets.

@cbandy
cbandy / git-revert-whitespace.sh
Created March 16, 2011 17:07
Undo trailing whitespace changes in working copy
#!/bin/sh
#
patch=$( mktemp .tmp.git.XXXXXX )
git diff --ignore-space-at-eol $@ > $patch
if [ $? -eq 0 ]; then
# detect EOF change