Is there a way I can utilize git to export/download my MySQL development database that is utilized in my code on a commit or some other way through git so that whenever I clone my project, I always have a current copy of the database?
If not, I can always export the database, and add it to the source, I was just wondering if git had the capability of doing this almost like a hook.
I ended up using the git hooks as I anticipated. I created the pre-commit
hook and added the following to it:
#!/bin/bash DBUSER="sysbackup" DBPASS="password" DB="database-name" SCHEMAPATH="DBSchema" mysqldump -u $DBUSER -p$DBPASS $DB > $SCHEMAPATH/$DB.sql git add $SCHEMAPATH/$DB.sql exit 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With