Skip to content

Instantly share code, notes, and snippets.

@wesliel
Created June 5, 2015 21:24
Show Gist options
  • Save wesliel/49615abcc44e809a2968 to your computer and use it in GitHub Desktop.
Save wesliel/49615abcc44e809a2968 to your computer and use it in GitHub Desktop.
Dump DB, add to Git, then commit and push
#!/bin/bash
DB_FILE=db_name_$(date +%s).sql
echo "Dumping DB..."
mysqldump DB_NAME -u DB_USER -pDB_PASSWORD > $DB_FILE
echo "done"
echo "Adding db to git"
git add $DB_FILE
git commit "add db dump"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment