笔名:  haibiscuit

博客园: https://www.cnblogs.com/haibiscuit/

Git地址: https://github.com/haibiscuit?tab=repositories  (欢迎star)

本项目地址: https://github.com/haibiscuit/StudyBook

尊重笔者的劳动成果,未经允许请不要转载

四:多人合作

多人合作的工作流程:

说明:

(1) master(当前版本)分支是主分支,因此本地要时刻与远程同步;

(2) dev(待更新版本)分支是开发分支,团队所有成员都需要在上面工作,所以所有成员的本地也需要与远程同步;

(3) michael和bob分支则是issue分支或团队成员的临时分支

多人开发的规范操作

(1) mkdir ProjectName   //本地创建项目文件夹

(2) cd  ProjectName   //进入项目文件夹

(3) git clone git@github.com:GithubName/ProjectName.git

//与远程分支建立关联

(4) git branch -r   //查看远程版本

(5) git fetch origin master   //将远程master分支信息拉取到本地,不作合并

(6) git checkout origin/master  //切换到远程版本分支

(7) git log     //查看远程版本提交

 

(以上七个步骤很重要,如果查看远程版本比本地版本高,则继续往下执行)

(8) git fetch origin master:temp

//从远程分支的origin仓库的master分支的信息下载到本地并新建分支temp

(9) git diff temp   //比较本地仓库和远程仓库的区别

(10) git merge temp    //本地合并远程分支

(11)

上面的操作还可以这么干

(1) git fetch    //拉取远程仓库的信息

(2) git diff origin/master //比较远程版本与本地的区别

(3) git merge origin/master    //合并远程版本

 

git merge出现冲突怎么办

(1) //首先根据提示解决冲突

(2) git add .&&git commit -m “”   //本地提交

(3) git push origin master      //提交远程

(注:如果第一次提交可以使用git push -u origin master)

Git实战指南----跟着haibiscuit学Git(第五篇)的更多相关文章

  1. Git实战指南----跟着haibiscuit学Git(第十一篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  2. Git实战指南----跟着haibiscuit学Git(第九篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  3. Git实战指南----跟着haibiscuit学Git(第六篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  4. Git实战指南----跟着haibiscuit学Git(第一篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  5. Git实战指南----跟着haibiscuit学Git(第二篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  6. Git实战指南----跟着haibiscuit学Git(第十篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  7. Git实战指南----跟着haibiscuit学Git(第八篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  8. Git实战指南----跟着haibiscuit学Git(第七篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  9. Git实战指南----跟着haibiscuit学Git(第四篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

随机推荐

  1. ansible模块之command、shell、script、file、copy、fetch

    前戏 ansible 批量在远程主机上执行命令 openpyxl 操作excel表格 puppet ansible slatstack ansible epel源 第一步: 下载epel源 wget ...

  2. 省市区三级联动(vue)

    vue项目中使用到三级联动,现在自己实现一个三级联动,仅供大家参考一下,直接上代码. <template> <section class="container"& ...

  3. user_login

    username=input("username:")password=input("password:")name,passwd='ducai','123'i ...

  4. yum安装PHP升级到7.1版本

    yum安装PHP升级到7.2版本卸载原来低版本的PHP rpm -qa |grep php|xargs rpm -e 更新yum源 //CentOS/RHEL 7.xrpm -Uvh https:// ...

  5. 学习c++11 ThreadPool【转】

    #ifndef THREAD_POOL_H #define THREAD_POOL_H #include <vector> #include <queue> #include ...

  6. 浅谈Spring AOP 面向切面编程 最通俗易懂的画图理解AOP、AOP通知执行顺序~

    简介 我们都知道,Spring 框架作为后端主流框架之一,最有特点的三部分就是IOC控制反转.依赖注入.以及AOP切面.当然AOP作为一个Spring 的重要组成模块,当然IOC是不依赖于Spring ...

  7. nginx篇高级用法之基于TCP/UDP的四层调度

    nginx 从1.9版本开始支持基于TCP/UDP的四层调度,在编译nginx时使用--with-stream开启该模块 支持TCP/UDP调度时,支持给所有的软件做调度器,例如:nfs smb ft ...

  8. 基于 JavaFX 开发的聊天客户端 OIM-即时通讯

    OIM 详细介绍 一.简介 OIM是一套即时通讯的聊天系统,在这里献给大家,一方面希望能够帮助对即时通讯有兴趣研究的朋友,希望我们能够共同进步,另一个就是希望能够帮助到需要即时通讯系统的朋友或者企业, ...

  9. csp-s2019游记

    11.15D0: 复习 复习 机房里弥漫着颓废的气息,不过也是最后一个下午了 11.16D1: 五点钟爬起来,一边发抖一边去楼下买早饭 虽然平时基本不吃早饭,但考前不行 搭着同学的车去了考点,在车上重 ...

  10. linux中jdk的安装

    //先检查jdk有没有安装 java -version   cp jdk-7u79-linux-x64.tar.gz /usr/local/ cd /usr/local/ tar -zxvf jdk- ...