Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created August 10, 2012 02:37
Show Gist options
  • Select an option

  • Save jcromartie/3310475 to your computer and use it in GitHub Desktop.

Select an option

Save jcromartie/3310475 to your computer and use it in GitHub Desktop.
bad-habit-breaking git pre-commit hook
#!/bin/sh
#
# A hook to prevent usage of the bad habit: commit -a
#
if ( ps -o pid,command | grep -q "${PPID} git commit -\w*a\w*" )
then
echo "please do not use \"commit -a\""
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment