This is an old revision of the document!
hooks
pre-commit: store compressed database dump with each commit
You probably wouldn't want to do this all the time. An example where it is very handy is if you might be working on a project that is a walkthrough from a book or web site. Although you can commit your code, it may depend on the state of the database. A prime example would be a drupal project.
#!/bin/sh # adds a compressed database dump to every commit echo "creating compressed database dump..." mysqldump -umysqluser -pmysqlpass databasename | gzip > filename.gz git add filename.gz exit $?