I have an existing git environment set up like this:
In order to deploy my changes to the production server, currently I:
git commiton the dev copy
git pushto send my changes to project.git, the central repository
- ssh into the production server
git pullon the live copy
I would like to eliminate steps 3 and 4 when pushing the master branch. I have found multiple tutorials (like this one) on using the
post-receive hook, but they all seem to assume that the bare repository will live on the production server, like this:
In this scenario the live copy can be updated using post-receive by setting
GIT_WORK_TREE to the correct local directory, and then running
git checkout -f master.
That's very slick, but it doesn't work with my existing environment. I could always move my central repo from the development server to the production server, but I'm hoping there's some straightforward way to just notify the live copy to do a
git pull automagically when the central repository receives a push.
Any suggestions, or should I just bite the bullet and move the central repo to production?