Skip to content

Instantly share code, notes, and snippets.

@wereHamster
Created June 9, 2011 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wereHamster/1017062 to your computer and use it in GitHub Desktop.
Save wereHamster/1017062 to your computer and use it in GitHub Desktop.
Clear all trailing whitespace in files modified since "$1"
#!/bin/sh
for FILE in `exec git diff --name-only "$1" --`; do
sed -E -i '' 's/[[:space:]]*$//' "$FILE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment