###0x00 在github上初始化repo 在github上开启一个代码库(repository), 具体方式参考github的帮助手册(help) 如下图所示, 现在整个项目了一个中心repo. 所有的项目成员将共用这一个repo.
01 在github上新建一个新的repo,作为远端的中心repo
###0x01 所有人clone中心repo
02 人员拓扑图
###0x02 Blue的Feature 场景假设, 假设有三个以上开发人员. 由于人员之间无差别对称, 所以列举两名成员Blue和Green的开发流程.
Blue同学先clone下repository.
03 从github的GUI工具clone repo 然后Blue同学需要完成如下工作:
1. 新建一个自己文件blue.go. 完成自己的任务.
2. 新建更改一个共有的源文件share.go, 将自己的名字添加到README文件中.
3. 查看本地repo状态. stage工程文件. commit(提交)代码到本地repo.
操作如下: > git status # View the state of the repo > git add # Stage a file > git commit # Commit a file 
04

05
###0x03 Green的Feature. Green的任务和Blue一样. 他执行了Blue一样的操作. (注意: Green自己的程序没有与他人的程序产生冲突,而和他人共建的程序发生了冲突. )
###0x04 Blue发布Feature
06
当Blue完成了自己的任务, 就将程序push到中心源码库中.命令如下: > git push origin master
结果如图:
07
###0x05 Green发布Feature
就在Blue完成自己任务之后, Green同学也完成了自己的任务,并尝试提交到github上. Green也执行了上一步中的命令. 但Green会面对下图的情况:
08
Green面对如下问题:
09
这是由于现在的中心库文件已经被Blue修改了,例如README.md, share.go和Green上传的版本存在冲突。所以,无法push成功。
###0x06 Green合并中心repo的程序 Green现在需要从中心repo将最新的代码取下来,和自己的本地代码整合,然后在提交到中心repo。
10
执行如下命令。 > git pull origin master 
11
显示存在冲突,Green需要手动调整冲突,然后重新commit后,才能将自己的程序push到中心repo. 
12

13
如图上图工具,在调整好冲突后,Green成功提交了代码。