Distributed workflow on GitHub, GitLab, local Git repository
1. shuijingwan/yii2-app-advanced (github), as shown in Figure 1
(1) Project maintainer: wangqiang
(2) Public warehouse:https://github.com/shuijingwan/yii2-app-advanced.git
(3) Visible grade of public warehouse: public
(4) The maintainer clones from the public warehouse, and performs pull and push in his own local repository (github-shuijingwan-yii2-app-advanced).
(5) Branch: long-term branch: master; short-term branch: function (feature) branch, pre-release (release) branch, patch bug (fixbug) branch
(6) shuijingwan/yii2-app-advanced(github) and yiisoft/yii2-app-advanced(github) keep synchronized based on composer
The specific process can be referred to:
2. Create a new project php/yii2-app-advanced on gitlab, as shown in Figure 2
Note:
(1) Project maintainer: wangqiang
(2) Public warehouse:https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(3) Visible level of public warehouse: internal
3. Clone from the public warehouse to the local warehouse (gitlab-php-yii2-app-advanced), as shown in Figure 3
4. Add the main contributor warehouse as a remote warehouse, as shown in Figure 4 (add/save the remote end), Figure 5 (not disabled to get the tag), Figure 6 (get remote branch), Figure 7 (determine), Figure 8 (off), and Figure 9 (determine)
Note:
(1) The main contributor warehouse:https://github.com/shuijingwan/yii2-app-advanced.git
(2) The visible level of the main contributor warehouse: public (can only be pulled, but cannot be pushed)
(3) The maintainer is cloned from the public warehouse, in his own local repository, add the main contributor warehouse as a remote warehouse, and execute the pull
Remote: github-shuijingwan-yii2-app-advanced
url:https://github.com/shuijingwan/yii2-app-advanced.git
(4) php/yii2-app-advanced(gitlab) keeps synchronized with shuijingwan/yii2-app-advanced(github)
5. The main contributor warehouse (https://github.com/shuijingwan/yii2-app-advanced.git)拉取至本地仓库,如图10
6. Push the pulled local warehouse to the public warehouse (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git),如图11
Note:
(1) The maintainer pushes the pulled local warehouse to the public warehouse
(2) Branch: long-term branch: master; short-term branch: function (feature) branch, pre-release (release) branch, patch bug (fixbug) branch
7. The main contributor repository of all projects on GitLab in the later period: php/yii2-app-advanced, create a new project on gitlab php/yii2-app-advanced-cmc, as shown in Figure 12
Note:
(1) Project maintainer: wangqiang
(2) Public warehouse:https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git
(3) Visible level of public warehouse: internal
8. From the public warehouse (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git)克隆至本地仓库(gitlab-php-yii2-app-advanced-cmc),如图13
9. Add the main contributor warehouse as a remote warehouse, as shown in Figure 14 (Add/Save Remote), Figure 15 (not disabled to get tags), Figure 16 (Get remote branch), Figure 17 (OK)
Note:
(1) The main contributor warehouse:https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(2) The visible level of the main contributor warehouse: public (can only be pulled, but cannot be pushed)
(3) The maintainer is cloned from the public warehouse, in his own local repository, add the main contributor warehouse as a remote warehouse, and execute the pull
Remote: gitlab-php-yii2-app-advanced
url:https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(4) php/yii2-app-advanced-cmc(gitlab) keeps synchronized with php/yii2-app-advanced (gitlab)
10. The main contributor warehouse (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git)拉取至本地仓库(gitlab-php-yii2-app-advanced-cmc),如图18
11. Push the pulled local repository (gitlab-php-yii2-app-advanced-cmc) to the public warehouse (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git),如图19
Note:
(1) The maintainer pushes the pulled local warehouse to the public warehouse
(2) Other contributors clone from the public warehouse, pull and push in their own local warehouse
(2) Branches: long-term branches: master, develop; short-term branches: function (feature) branch, pre-release (release) branch, patch bug (fixbug) branch
12, php/yii2-app-advanced-cmc (gitlab), create a new branch develop, as shown in Figure 20
13. After the local warehouse is pulled, switch to the develop branch and merge, as shown in Figure 21 and Figure 22





















