I’m trying to get my head around what a proper workflow might look like using Git. As I’ve been reading it seems that I want to to a—bare init for the repositories on the production for sure, but I’m not sure about the staging? I’ve installed Git locally and on my staging server. Locally everything seems to work great. I’ve been able to create a few test branches and all seems to work great. I haven’t tried to push anything to the staging yet. I’m not sure what the proper procedure is for that? Below is what I’m coming up so far after reading numerous posts and looking at the Git docs.
1. Should I have a repository on the production server? If so, is this a special kind of repo? It doesn’t seem like you’d want any branches here. Only the master that you can push to.
2. Should I build the repository on the staging server and clone down to the local machines?
3. Then, push changes from local back to staging and then up to production?
4. Where is the best place to put the .git directories on the remote servers? In the root? Or, outside of the root?
I’m probably missing some other elements here. So, any guidance or help is appreciated.