Skip to content

Instantly share code, notes, and snippets.

@undoZen
Created January 23, 2014 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save undoZen/8575631 to your computer and use it in GitHub Desktop.
Save undoZen/8575631 to your computer and use it in GitHub Desktop.
post-commit
#!/bin/sh
unset GIT_DIR
git stash | grep -q 'No local changes'
RETVAL=$?
grunt
git add -A public/
git commit -m '[post-commit] static files generated by grunt'
[ $RETVAL -ne 0 ] && git stash pop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment