Skip to content

Instantly share code, notes, and snippets.

View MarcoPriebe's full-sized avatar

Marco Priebe MarcoPriebe

View GitHub Profile
@MarcoPriebe
MarcoPriebe / pre-commit
Last active June 8, 2022 14:10
pre-commit git hook to remove trailing whitespace
#!/bin/bash
#
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
# Logic:
#
# The 'git stash save' fails if the tree is clean (instead of
# creating an empty stash :P). So, we only 'stash' and 'pop' if