How to merge two remote Git branches?

I am setting up a remote repo, which should contain both an intermediate 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 allow only the transfer of changes from local machines to the remote intermediate branch, and then, when we decided that the intermediate branch is good, we can merge the intermediate branch into the production branch, and then expand from there.

Basically, something like:

  • local.branch → remote.staging
  • test on an intermediate server
  • remote.staging → remote.production
  • remote.production deployment

Is it possible to manage remote repositories this way? If so, how?

Also, is there a better way to do this?

+4
source share
1 answer

I believe that (a) a normal / supported workflow will be

  • local (stage) .branch → remote.staging
  • test on an intermediate server
  • local (intermediate) .branch → local (production) .branch
  • local (production) .branch → remote.production
  • remote.production deployment

Is it possible that the script is not suitable for you?

+5
source

Source: https://habr.com/ru/post/1338769/


All Articles