Skip to content

Instantly share code, notes, and snippets.

View maieul's full-sized avatar

Maïeul Rouquette maieul

View GitHub Profile
@dpaluy
dpaluy / git.sh
Last active June 26, 2020 05:34
Remove trailing whitespace of all files recursively
# Git repository-specific solution
# Source: http://unix.stackexchange.com/questions/36233/how-to-skip-file-in-sed-if-it-contains-regex/36240#36240
git grep -I --name-only -z -e '' | xargs -0 sed -i -e 's/[ \t]\+\(\r\?\)$/\1/'