简体   繁体   中英

Github workflow questions

I have a question about Git workflow. We have 3 environments that we develop in - 'production', 'practice', and 'training'. Production contains all stable and tested code, Practice contains all developmental code, and Training is essentially a mirror of Production.

Currently we are writing all code within 'Practice', doing QA, and pushing it over to 'Production'. We will later copy 'Production' over to 'Training'.

Do we need 3 separate repositories for each environment, or would this be workable with 3 branches ? Is there a disadvantage to doing this either way? Can you easily merge code from one repo to another?

I would like to keep a running history of what we merged from 'Practice' to 'Production', as well as an easy way to rollback any commits/merges. We are only working 3 (hopefully more soon) developers.

Any advice would be appreciated!

Please create a separate repo out of "Production", let's call this as "Practise".

All development code can be done on "Practise".

Incremental merge can be done from Practise to Production.

repo checkout Production repo merge Prcatise.

Before merging create a branch out of Production which keeps the copy of Production before merge.

git checkout Production git branch BEFORE_MERGE_1

Like this using 2 seperate repos you can handle your git workflow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM