Skip to content

Instantly share code, notes, and snippets.

@shiva
Last active December 30, 2016 06:06
Show Gist options
  • Save shiva/7f5ab9dbc7ed5bea59a4ce03aa2c9fb8 to your computer and use it in GitHub Desktop.
Save shiva/7f5ab9dbc7ed5bea59a4ce03aa2c9fb8 to your computer and use it in GitHub Desktop.
Remove trailing whitespaces in all of the files modified in the last git commit
alias remove-whitespace='sed -e '\''s/[[:blank:]]\+$//'\'' -i'
alias remove-ws-in-last-commit= 'for f in `git show --name-only --pretty=""`; do echo $f; remove-whitespace $f; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment