Git: Export MySQL database on commit? Git: Export MySQL database on commit? git git

Git: Export MySQL database on commit?


I ended up using the git hooks as I anticipated. I created the pre-commit hook and added the following to it:

#!/bin/bashDBUSER="sysbackup"DBPASS="password"DB="database-name"SCHEMAPATH="DBSchema"mysqldump -u $DBUSER -p$DBPASS $DB > $SCHEMAPATH/$DB.sqlgit add $SCHEMAPATH/$DB.sqlexit 0