[转] git fetch与pull
原文: http://www.tech126.com/git-fetch-pull/
1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge
git fetch origin master
git log -p master..origin/master
git merge origin/master
以上命令的含义:
首先从远程的origin的master主分支下载最新的版本到origin/master分支上
然后比较本地的master分支和origin/master分支的差别
最后进行合并
上述过程其实可以用以下更清晰的方式来进行:
git fetch origin master:tmp
git diff tmp
git merge tmp
从远程获取最新的版本到本地的test分支上
之后再进行比较合并
2. git pull:相当于是从远程获取最新版本并merge到本地
git pull origin master
上述命令其实相当于git fetch 和 git merge
在实际使用中,git fetch更安全一些
因为在merge前,我们可以查看更新情况,然后再决定是否合并
[转] git fetch与pull的更多相关文章
- git fetch, merge, pull, push需要注意的地方(转)
在git操作中,我们经常会用到fetch, merge, pull和push等命令,以下是一些我们需要注意的地方. 给大家准备了参考资料: 1. Whatʼs a Fast Forward Merge ...
- git fetch, merge, pull, push需要注意的地方
在git操作中,我们经常会用到fetch, merge, pull和push等命令,以下是一些我们需要注意的地方. 给大家准备了参考资料: 1. Whatʼs a Fast Forward Merge ...
- git fetch和pull的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令: 1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge 1 2 3 Git fetch origin master ...
- Git 少用 Pull 多用 Fetch 和 Merge
本文有点长而且有点乱,但就像Mark Twain Blaise Pascal的笑话里说的那样:我没有时间让它更短些.在Git的邮件列表里有很多关于本文的讨论,我会尽量把其中相关的观点列在下面. 我最常 ...
- git pull和git fetch的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge Git fetch origin master git log ...
- Git fetch和git pull的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge git fetch origin mastergit log - ...
- git fetch和git pull(转载)
From:http://www.tech126.com/git-fetch-pull/ Git中从远程的分支获取最新的版本到本地有这样2个命令: 1. git fetch:相当于是从远程获取最新版本到 ...
- 真正理解 git fetch, git pull 以及 FETCH_HEAD【转】
转自:http://www.cnblogs.com/ToDoToTry/p/4095626.html 真正理解 git fetch, git pull 要讲清楚git fetch,git pull,必 ...
- git fetch和git pull之间的区别--转载
原文地址:http://blog.csdn.net/a19881029/article/details/42245955 git fetch和git pull都可以用来更新本地库,它们之间有什么区别呢 ...
随机推荐
- mouse scrollings and zooming operations in linux & windows are opposite
mouse scrollings and zooming operations in linux & windows are opposite. windows中, 鼠标滚动的方向是: 查看页 ...
- 安装opensuse的笔记-重庆linux开源组织
mate: 伙伴 matey: 融洽的, 易于亲近的. get matey with sb. poison: a. 有毒的, n.毒药/毒酒v. 下毒, 破坏, 污染 slander [ 撕烂的~~] ...
- shell学习之路:重定向符号的使用
http://note.youdao.com/share/?id=096963bf2a0862fd338919d781636be2&type=note 快捷键:
- Linux下用于查看系统当前登录用户信息的4种方法
1. 使用w命令查看登录用户正在使用的进程信息 w命令用于显示已经登录系统的用户的名称,以及他们正在做的事.该命令所使用的信息来源于/var/run/utmp文件.w命令输出的信息包括: 用户名称 用 ...
- WCF--提示:异常消息为“传入消息的消息格式不应为“Raw”。此操作的消息格式应为 'Xml', 'Json'。
Ajax调用WCF服务... 本来用 // $.getJSON("http://localhost:16625/Service1.svc/Article_GetInfo", { } ...
- Net上传附件大小控控值(转)
Server Error 404 – File or directory not found. The resource you are looking for might have been rem ...
- SparkSql 不支持Date Format (支持Timestamp)
最近项目中需要用到sparksql ,需要查询sql Date类型, 无奈,官方现阶段 1.6.0 还不支持Date类型,不过支持Timestamp类型,所以问题可以解决了. 1.解析 SimpleD ...
- linux下svn命令使用大全
最近经常使用svn进行代码管理,这些命令老是记不住,得经常上网查,终于找了一个linux下svn命令使用大全:1.将文件checkout到本地目录 svn checkout path(path是服务器 ...
- java之stream(jdk8)
一.stream介绍 参考: Java 8 中的 Streams API 详解 Package java.util.stream Java8初体验(二)Stream语法详解 二.例子 im ...
- centos7 静态ip设置
TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV ...