I have a central server acting as a git server, and I push my changes from another pc. I work in parallel with another developer, too. He prepared a hook in the git server so when we pushed it pulls any change.
What we would want to do now is to also pull from a production server. We work with two main branches (master and stable), so when we decide to commit something as stable, we would like the production server to pull it in any way. I’m not plenty sure if it is possible to pull on demand, but I have found little to no information about this aspect. Do you have any idea? Thanks in advance.
Your question is not exactly clear and requires more details on your setup.
If you want to pull in your production server ( or push to your production server from the central server ), and if you are using a hook like
update,post-receiveorpost-update, you can easily make thempullorpushonly if you commit to the stable branch.Taking the specific example of an
updatehook on the central server, it takes three parameters:By checking the name of the ref to be what you want( stable ) and then doing a
pushorpullto the production server will help you achieve the selective update that you want.http://git-scm.com/docs/githooks