没有不值得去解决的问题,也没有不值得去学习的技术!

Distributed Workflows for GitHub, GitLab, and Local Git Repositories

Add/Save Remote

1. shuijingwan/yii2-app-advanced (GitHub), as shown in Figure 1
(1) Project maintainer: wangqiang
(2) Public repository: https://github.com/shuijingwan/yii2-app-advanced.git
(3) Public repository visibility level: Public
(4) The maintainer clones from the public repository and performs pulls and pushes in their own local repository (github-shuijingwan-yii2-app-advanced)
(5) Branches: Long-lived branches: master; Short-lived branches: feature branches, release branches, fixbug branches
(6) shuijingwan/yii2-app-advanced (GitHub) and yiisoft/yii2-app-advanced (GitHub) stay synchronized via Composer
For the specific workflow, refer to:
https://www.shuijingwanwq.com/2018/04/03/2530/
https://www.shuijingwanwq.com/2018/04/04/2559/
https://www.shuijingwanwq.com/2018/04/09/2576/
https://www.shuijingwanwq.com/2018/04/13/2597/

shuijingwan/yii2-app-advanced (GitHub) and yiisoft/yii2-app-advanced (GitHub) stay synchronized via Composer
Figure 1

2. Create a new project php/yii2-app-advanced on GitLab, as shown in Figure 2
Note:
(1) Project maintainer: wangqiang
(2) Public repository: https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(3) Public repository visibility level: Internal

Create a new project php/yii2-app-advanced on GitLab
Figure 2

3. Clone from the public repository to the local repository (gitlab-php-yii2-app-advanced), as shown in Figure 3

Clone from the public repository to the local repository (gitlab-php-yii2-app-advanced)
Figure 3

4. Add the main contributor repository as a remote repository, as shown in Figure 4 (Add/Save Remote), Figure 5 (Do not disable fetching tags), Figure 6 (Fetch remote branches), Figure 7 (OK), Figure 8 (Close), and Figure 9 (OK)
Note:
(1) Main contributor repository: https://github.com/shuijingwan/yii2-app-advanced.git
(2) Main contributor repository visibility level: Public (can only pull, cannot push)
(3) The maintainer clones from the public repository, adds the main contributor repository as a remote repository in their own local repository, and performs a pull
Remote: github-shuijingwan-yii2-app-advanced
URL: https://github.com/shuijingwan/yii2-app-advanced.git
(4) php/yii2-app-advanced (GitLab) and shuijingwan/yii2-app-advanced (GitHub) stay synchronized

Add/Save Remote
Figure 4
Do not disable fetching tags
Figure 5
Figure 6
Fetch remote branches
OK
Figure 7
Close
Figure 8
OK
Figure 9

5. Pull the main contributor repository (https://github.com/shuijingwan/yii2-app-advanced.git) to the local repository, as shown in Figure 10

Pull the main contributor repository (https://github.com/shuijingwan/yii2-app-advanced.git) to the local repository
Figure 10

6. Push the pulled local repository to the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git), as shown in Figure 11
Note:
(1) The maintainer pushes the pulled local repository to the public repository
(2) Branches: Long-lived branches: master; Short-lived branches: feature branches, release branches, fixbug branches

Push the pulled local repository to the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git)
Figure 11

7. The main contributor repository for all subsequent projects on GitLab is php/yii2-app-advanced. Create a new project php/yii2-app-advanced-cmc on GitLab, as shown in Figure 12
Note:
(1) Project maintainer: wangqiang
(2) Public repository: https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git
(3) Public repository visibility level: Internal

The main contributor repository for all subsequent projects on GitLab is php/yii2-app-advanced. Create a new project php/yii2-app-advanced-cmc on GitLab
Figure 12

8. Clone from the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git) to the local repository (gitlab-php-yii2-app-advanced-cmc), as shown in Figure 13

Clone from the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git) to the local repository (gitlab-php-yii2-app-advanced-cmc)
Figure 13

9. Add the main contributor repository as a remote repository, as shown in Figure 14 (Add/Save Remote), Figure 15 (Do not disable fetching tags), Figure 16 (Fetch remote branches), and Figure 17 (OK)
Note:
(1) Main contributor repository: https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(2) Main contributor repository visibility level: Public (can only pull, cannot push)
(3) The maintainer clones from the public repository, adds the main contributor repository as a remote repository in their own local repository, and performs a pull
Remote: gitlab-php-yii2-app-advanced
URL: https://gitlab.chinamcloud.com/php/yii2-app-advanced.git
(4) php/yii2-app-advanced-cmc (GitLab) and php/yii2-app-advanced (GitLab) stay synchronized

Add/Save Remote
Figure 14
Do not disable fetching tags
Figure 15
Fetch remote branches
Figure 16
OK
Figure 17

10. Pull the main contributor repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git) to the local repository (gitlab-php-yii2-app-advanced-cmc), as shown in Figure 18

Pull the main contributor repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced.git) to the local repository (gitlab-php-yii2-app-advanced-cmc)
Figure 18

11. Push the pulled local repository (gitlab-php-yii2-app-advanced-cmc) to the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git), as shown in Figure 19
Note:
(1) The maintainer pushes the pulled local repository to the public repository
(2) Other contributors clone from the public repository and perform pulls and pushes in their own local repositories
(2) Branches: Long-lived branches: master, develop; Short-lived branches: feature branches, release branches, fixbug branches

Push the pulled local repository (gitlab-php-yii2-app-advanced-cmc) to the public repository (https://gitlab.chinamcloud.com/php/yii2-app-advanced-cmc.git)
Figure 19

12. In php/yii2-app-advanced-cmc (GitLab), create a new branch develop, as shown in Figure 20

In php/yii2-app-advanced-cmc (GitLab), create a new branch develop
Figure 20

13. After pulling in the local repository, switch to the develop branch and merge, as shown in Figure 21 and Figure 22

After pulling in the local repository, switch to the develop branch
Figure 21
Merge
Figure 22

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系