Pushing to a remote git working copy
In the case where the remote working copy is the document root of your site and no one is ever making changes there, it's extremely annoying that git provides no flag to the push command to allow you to update the work tree as opposed to only the index.
Enter the post-update hook.
- download the post-update hook
- in the remote working copy (which you don't intend to actually work in), place the post-update file in $working_copy/.git/hooks
- make it executable
Voila. The working copy now actually updates when you push to it.
You will probably also want to suppress the long warning message that spews out every time you do this.
On the remote working copy:
$ git config receive.denyCurrentBranch ignore
Advanced note: if you'd like to automatically pop stashed remote working copy changes back onto HEAD, see the attached stash-pop.patch to the post-update hook. Use at your own risk. ;)