Created
June 6, 2013 16:15
-
-
Save glauckner/5722788 to your computer and use it in GitHub Desktop.
Git pre commit hook to export database
This file contains hidden or 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="" | |
DB="wordpress_bio" | |
SCHEMAPATH="__sql" | |
if [ ! -d "$SCHEMAPATH" ]; then | |
mkdir $SCHEMAPATH | |
fi | |
C:/xampp/mysql/bin/mysqldump -u $DBUSER --password=$DBPASS $DB > $SCHEMAPATH/$DB.sql | |
git add $SCHEMAPATH/$DB.sql | |
echo 'Exported and added Database to commit' | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment