search

Home  >  Q&A  >  body text

请推荐一个适合4-6人小团队的git代码管理模式?

关于分支,发布等组织方式,求大家推荐,谢谢~~

能和github结合起来讲就最好啦,因为想采用github作为代码仓库

说一下我自己的思路吧

开始

开始的时候,创建一个主仓库,假设叫master_github,里面建立两个分支,master和develop分支,master分支用来发布,develop分支用来开发

新成员加入

一个新成员加入的时候,首先要fork主仓库master_github,假设fork之后的仓库叫做member_github,新成员把member_github的代码clone到本地,然后checkout develop分支下进行开发

提交

当member_github的develop分支开发的功能完成,并且通过测试之后,先提交到本地的仓库,然后通过push到member_github仓库,然后再向master_github发pull request

合并

master_github管理员决定是否合并来自member_github的pull request

发布

当develop分支merge来自各个member_github的功能达到一个发布时,把develop分支rebase到master分支,进行发布

以上是我的思路,请大家帮忙看看是否规范,有没有哪里有问题的,不知道master_github中的一个develop分支是否够用?

还有个问题就是发布版的bug修复应该怎么弄呢,在master_github中再创建分支吗?等bug修复玩再合并到develop和master里面吗?

怪我咯怪我咯2779 days ago695

reply all(4)I'll reply

  • PHPz

    PHPz2017-04-24 09:14:25

    If you have a small team and work together, using github pull is a bit expensive,
    You can definitely use one of the following methods:

    • Review locally, submit to develop branch after passing, and release to master at the right time
    • Submit directly to the devlop branch. If it is not suitable, revert it back. This may cause some trouble
    • Everyone maintains his or her own branch, and then a dedicated person merges it into develop

    In this way, you can also use other functions such as github issues.

    reply
    0
  • 黄舟

    黄舟2017-04-24 09:14:25

    Using sourcetree’s git workflow is very convenient~~~

    reply
    0
  • 阿神

    阿神2017-04-24 09:14:25

    I will answer it myself

    git flow

    The above is a relatively classic git flow

    Still looking for information about forking workflow

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-24 09:14:25

    Let’s talk about how we currently use git branches

    The overall project is divided into two branches: master and develop. Master is mainly used to publish websites. develop is mainly used for separate use.
    When everyone develops, they clone it from develop and create a developer's own branch, such as zhang. (When there are new joiners, use the same method to rename the branch li.). When the development work is completed, submit the local warehouse and git push your own branch. Finally, merge develop into your own branch (it may have been modified by the developer during development) to ensure that the merge is successful. After the merge is correct, merge the currently merged zhang branch into the develop branch. (Note: The merge operation here is first merged into the local branch. Then merged into the remote branch. It is a bit more than one step).
    After the last day of work, develop will be merged into the master branch and run online through master.

    In addition, when there are urgent bugs that need to be corrected in the online environment. Then create a branch from master. Independent maintenance. After that, synchronize the master and develop branches respectively.

    reply
    0
  • Cancelreply