团队内部使用gitlab的fork&pull request模式的不解
滿天的星座
滿天的星座 2017-05-02 09:28:16
0
4
720

如题。
现在公司使用的是gitlab,大概使用流程入下:
1.老大创建一个主仓库mainrepo
2.每个成员fork一份mainrepo
3.在自己fork出来的代码里做开发
4.开发完成后发出一个合并请求,等待老大合并代码
5.如果主仓库有新更新,先fetch,然后合并到自己的仓库里

我感觉这样做好麻烦啊,而且git的分支优势体现的不是很明显。
大家觉得这种工作模式怎么样?

滿天的星座
滿天的星座

reply all(4)
过去多啦不再A梦

Two ways:

  1. Everyone uses the same warehouse for collaborative development, branch development functions, after development is completed, establishedmerge request,进行code review, and finally merged into the develop branch

  2. You can also merge it fork mainrepo, 开发完毕后,建立pull requestmainrepo
    by the person who manages the code

Benefits of using the second method:

  • Protection mainrepo, 所有的合并操作必须使用pull request, cannot simply merge

  • The branches of
  • mainrepo are more concise and do not contain redundant branches

  • Individuals maintain branches in their own private warehouses, and there will be no duplicate names when creating branches

  • I personally emphasize on contributing code and contribute more code to mainrepo

我想大声告诉你

Well, this really doesn’t take advantage of branches.
There should not be only one mainrepo branch. Development, feature, hotfix branches, etc. should be separated according to needs. This is developed on the corresponding branch.

过去多啦不再A梦

Of course it’s okay to do this. Your boss probably has his reasons for doing this.
However, this method of management is very centralized and does not conform to the distributed idea of ​​git, so using git is not very suitable.

左手右手慢动作

The steps I understand

  • Boss Creation Library

  • Master designated boss can merge

  • Create a dev library as a test environment library, and only the boss or designated manager can merge it.

  • Each developer creates his or her own branch, then pushes it to the remote factory, and then the boss or manager goes to dev merge and pushes the upstream branch.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template