Skip to content

Instantly share code, notes, and snippets.

@j0hn
Created August 9, 2012 18:19
Show Gist options
  • Select an option

  • Save j0hn/3306767 to your computer and use it in GitHub Desktop.

Select an option

Save j0hn/3306767 to your computer and use it in GitHub Desktop.
git pre commit hook to ask the user if he ran the tests
#!/bin/sh
# file .git/hooks/pre-commit
exec < /dev/tty
read -p "Did you run the tests? [yN]: " yn
case $yn in
[Yy]* ) echo "Ok, your good to go";;
* ) echo "What are you waiting for then?" && exit 1;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment