Skip to content

Instantly share code, notes, and snippets.

@bartkamphuis
Forked from shrwnsan/post-merge
Created December 7, 2013 00:06
Show Gist options
  • Select an option

  • Save bartkamphuis/7834870 to your computer and use it in GitHub Desktop.

Select an option

Save bartkamphuis/7834870 to your computer and use it in GitHub Desktop.
#!/bin/sh
cd /path/to/your/repo/
gunzip -v < [database].sql.gz | mysql -u [mysql_user] -p[mysql_password] [database]
# Note:
# No need to have these comments in the file...
# This file's location @ /path/to/your/repo/.git/hooks/post-merge
# Be sure to make this file executable via:
# sudo chmod +x /path/to/your/repo/.git/hooks/post-merge
#!/bin/sh
mysqldump -h localhost -u [mysql_user] -p[mysql_password] --skip-extended-insert [database] | gzip > /path/to/your/repo/[database].sql.gz
cd /path/to/your/repo/
git add [database].sql.gz
# Note:
# No need to have these comments in the file...
# This file's location @ /path/to/your/repo/.git/hooks/pre-commit
# Be sure to make this file executable via:
# sudo chmod +x /path/to/your/repo/.git/hooks/pre-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment