Created
September 20, 2017 16:20
-
-
Save webrgp/4ed4ae49b6c7bfdd5e59f5635f550821 to your computer and use it in GitHub Desktop.
Add DB dump to git's pre-commit hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DBUSER="root" | |
DBPASS="root" | |
DB="DB_NAME" | |
SCHEMAPATH="DBSchema" | |
/Applications/MAMP/Library/bin/mysqldump -u $DBUSER -p$DBPASS $DB > $SCHEMAPATH/$DB.sql | |
git add $SCHEMAPATH/$DB.sql | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment