Git分支管理和常见的分支工作流

1. Branch Management

  • 查看分支

    git branch

  • 查看分支并显示每个分支最后一次提交

    $ git branch -v
      iss53   93b412c Fix javascript issue
    * master  7a98805 Merge branch 'iss53'
      testing 782fd34 Add scott to the author list in the readme
    
  • 查看已合并、未合并的分支

    git branch --merged

    git branch --no-merged

2. Branching Workflows

利用分支的两种典型工作流:

  1. master分支用来管理稳定发布版本的代码;

    另外搞个平行分支 develop用于管理测试版本、不稳定代码

    测试通过,将develop分支合并进master分支

  2. topic branch:为了一个新功能、新想法,你可以临时随心所欲的开新分支。

更多讨论:https://github.com/pluscai/use-git/issues/20

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章