I am setting up a remote repo that needs to house both a staging version of my code and a production version of the code (each branch will be deployed to their designated servers for testing / production).
I would like to only allow changes to be pushed from local machines to the remote staging branch, and then when we have decided that the staging branch is good to go, we could merge the staging branch into the production branch, and then deploy from there.
Basically, something like:
- local.branch -> remote.staging
- test on staging server
- remote.staging -> remote.production
- deploy remote.production
Is it possible to manage remote repos in this way? If so how?
Also, is there a better way to do this?
I believe that the (a) normal/supported workflow would be
Is that a scenario not possible for you?