I am somewhat new to Git only and I have only used it for basic projects with simple setups. Now I am struggling to wrap my head around a more complex setup. I have been up all night Googling but I can't find anything related to how I want to set this up.
I have three servers on my network: one for development (dev.example.com), one for production (www.example.com), and another that acts a central stage between the two (central.example.com).
I want to create a main (probably bare) Git repository on Central that I can push to from my local machine (which is separate from the three main servers but on the same network). Ideally, this repo would have two branches: master and Development. My local machine will only deal with this repo on Central.
When I push to the dev branch on Central, Central should then push those changes to the DEV server. Likewise, changes to the master branch should be pushed to WWW. I think using a commit/update hook would be the best way to accomplish this.
Here is a crudely drawn diagram:
Local
|
Central
/ \
DEV WWW
Could someone kindly point me in the right direction? Thanks!