1.pull = fetch + merge

In the simplest terms, git pull does a git fetch followed by a git merge.

You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never

changes any of your own local branches under refs/heads, and is safe to do without changing your working copy.  I have even heard

of people running git fetch periodically in a cron job in the background (although I wouldn't recommend doing this).

git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other

remote-tracking branches.

2. merge VS rebase

2.1、merge命令

把origin分支上的修改拉下来并且和你的修改合并;产生一个合并的提交(merge commit):

2.2、rebase命令

把你的分支里的每个提交(commit)取消掉,并且把它们临时保存为补丁(patch)(.git/rebase目录),然后把你的分支更新到最新的origin分支,

最后把保存的这些补丁应用到你的分支上。在rebase的过程中,也许会出现冲突(conflict),Git会停止rebase并会让你去解决 冲突;在解决完冲突后,

用"git-add"命令去更新这些内容的索引(index), 然后,你无需执行 git-commit,只要执行:

$ git rebase --continue

这样git会继续应用(apply)余下的补丁。在任何时候,你可以用--abort参数来终止rebase的行动,你的分支会回到rebase开始前的状态。

$ git rebase --abort

3. git merge VS git merge --no-ff

git merge 在没有冲突的时候不会生成新的commit。

如果想在没有冲突的情况下也自动生成一个commit,记录此次合并就可以用:git merge --no-ff命令。

最新文章

  1. Oracle用法、函数备忘记录
  2. 浅谈JS之AJAX
  3. 跨域API
  4. 软删除脏数据job笔记
  5. WPFのInkCanvas作为蒙版透明笔迹不透明
  6. Heartbeat+LVS构建高可用负载均衡集群
  7. Java实现Socket5代理服务器
  8. Android中的TextView实现多行显示省略号
  9. Python操作IHTMLDocument2用于自动化测试
  10. 用 Google 挖掘赚钱思路
  11. 制作Windows服务项目详细攻略
  12. 开源纯C#工控网关+组态软件(九)定制Visual Studio
  13. 一篇关于Asp.Net Model验证响应消息的问题处理
  14. Python学习(十六)—— 数据库
  15. Elasticsearch索引mapping的写入、查看与修改(转)
  16. GoldenGate 12.3 MA架构介绍系列(5) - 静默安装
  17. python opencv show图片,debug技巧
  18. 最全的前端Git基础命令,看完保证你会!
  19. 获取docker容器的ip地址
  20. JavaScript判断值是否是NaN

热门文章

  1. 关于love2d教程的更新
  2. 继承log4.net的类
  3. xeno 实时性能测试 系统时钟1秒100个tick再测试
  4. Js常用插件介绍
  5. div允许用户输入
  6. ES6学习笔记(1,let和const)
  7. libcurl库的编译
  8. TensorFlow基础笔记(6) 图像风格化实验
  9. ThinkPHP项目笔记之登录,注册,安全退出篇
  10. 电脑端与iPad 端如何共享ChemDraw结构