Git Pull Request 协作式开发流程

pull request 协作式开发流程

优点:

  • 主仓库自己只有管理员有权限修改,安全;合并代码之前管理员可以进行审核;
  • 每个开发者有自己的远程仓库,可以随时push代码而不影响协作者;

说明:

流程

1. fork 自己的仓库

2. git clone 自己的仓库到本地

git remote -v

origin  [email protected]:fankailun/markup-designer.git (fetch)
origin  [email protected]:fankailun/markup-designer.git (push)

3. 添加本地仓库和公共仓库的关联

git remote add public 公共仓库地址

origin  [email protected]:fankailun/markup-designer.git (fetch)
origin  [email protected]:fankailun/markup-designer.git (push)
upstream    [email protected]:TrionesFE/markup-designer.git (fetch)
upstream    [email protected]:TrionesFE/markup-designer.git (push)

4.本地开发

5.git pull public master

6. git push

查看关联关系
git branch -vv

7. merge request

公共仓库增加了分支怎么办

git checkout -b new-branch public/new-branch

git branch -vv

  dev      bdbfefc [origin/dev] get back template ability
* triones2 eef4796 [upstream/triones2] Merge branch 'triones2' into 'triones2'

git push origin new-branch

git branch -u origin/new-branch new-branch

git branch -vv

  dev      bdbfefc [origin/dev] get back template ability
* triones2 eef4796 [origin/triones2] Merge branch 'triones2' into 'triones2'

猜你喜欢

转载自www.cnblogs.com/aloe-n/p/11127582.html