I'm hitting another wall in my quest to get better understanding of Git and the right web deployment workflow. I'm a novice when it comes to server related softwares and unix commands, so keep that in mind when answering. A bunch of questions have been asked on similar topics, but I'm not finding anything on specific push and merge to remote repositories with a post-receive hook.
I have 3 stages set for deployment.
Production (remote server I assume bare repository)
^
Staging (remote server bare repository)
^
Development (local machine)
I have Git up and running on my local and staging environments so far. I have a post-receive hook set up on my staging server. This seems to work great so far, but it doesn't seem that this hook will allow me to push branches that can be seen on the staging server. The staging server only serves the pages in the state of the master branch. This is probably expected behavior.
Should I be using this hook on the staging server? The only way I can seem to make changes go live is to first merge to the master on my local machine and then push that to staging. This doesn't seem right, because if the change needs adjusting. I would have to undo the merge on the local?
I'm pretty certain that the bare repository and post-receive hook will work great on the production server. Because it should really only have one state.
These may all be normal behaviors and my workflow may be incorrect. Any help on this or guidance is appreciated. I have searched this and I'm not finding any clear documentation.