Git hook update database, re: deployment, git hooks, migrations ... updating your app with command line
It takes a single parameter, the name of the file that holds the e-mail to be sent. First, we need to read the standard input.
I have a pre-commit hook for git which mysqldumps the database, and stages the file for committing. Pushing to the production server will deploy our changes: The second parameter is the branch being rebased, and is not set when rebasing the current branch.
The easiest way to do this is to get all commits between the old and the new SHA-1 and perform our check on that. This work-flow is great for testing out changes prior to moving them to production. This time, we are interested in the post-receive hook, which is run on the server receiving a git push.
A zero exit from the update hook allows the ref to be updated.
You will also need to know the location of the bare repository you set up in relation to the user's home directory. It can be used to inspect the current working tree and refuse to make a commit if it does not pass certain test.
It should look like this: