Skip to content

Instantly share code, notes, and snippets.

@bradfordcp
Created May 24, 2011 18:21
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 bradfordcp/989308 to your computer and use it in GitHub Desktop.
Save bradfordcp/989308 to your computer and use it in GitHub Desktop.
Pre-commit git hook to regenerate documentation and add it to the commit
inm-bradfordcp-mbp:some_folder bradfordcp$ cat .git/hooks/pre-commit
#!/bin/sh
#
# Regenerates documentation and adds it to the commit
#
echo
echo "Regenerating Documentation"
echo
rake doc:generate
echo
echo
echo "Regeneration complete"
echo
echo "Adding updated docs to commit"
echo
git add docs
git add -u docs
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment