git fetch和git pull(转载)
From:http://www.tech126.com/git-fetch-pull/
Git中从远程的分支获取最新的版本到本地有这样2个命令:
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 fetch更新版本库镜像
git fetch的另一个用法是将镜像版本库对应的远程版本库的更新同步到镜像版本库。
在xxx.git镜像版本库目录下,执行git fetch,即可将远程版本库的更新同步到本地镜像。
3. git pull:相当于是从远程获取最新版本并merge到本地
git pull origin master
上述命令其实相当于git fetch 和 git merge;
在实际使用中,git fetch更安全一些;
因为在merge前,我们可以查看更新情况,然后再决定是否合并。
git fetch和git pull(转载)的更多相关文章
- git fetch和git pull之间的区别--转载
原文地址:http://blog.csdn.net/a19881029/article/details/42245955 git fetch和git pull都可以用来更新本地库,它们之间有什么区别呢 ...
- Git fetch和git pull的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge git fetch origin mastergit log - ...
- Git fetch和git pull的区别(转)
原文: http://www.tech126.com/git-fetch-pull/ Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地 ...
- 关于git fetch 和git pull 的区别
1.fetch 相当于是从远程获取最新版本呢到本地,不会自动merge. git fetch origin master:tmpgit diff tmp git merge tmp 2. git pu ...
- git fetch 、git pull 与 git pull --rebase
1. git fetch 与 git pull 都是从远程拉取代码到本地,git fetch只是拉取到本地,git pull不仅拉取到本地还merge到本地分支中.所以git pull是git fet ...
- git fetch , git pull
要讲清楚git fetch,git pull,必须要附加讲清楚git remote,git merge .远程repo, branch . commit-id 以及 FETCH_HEAD. 1. [g ...
- git fetch and git pull &冲突
1.git fetch和git pull之间的区别 git fetch只会将本地库所关联的远程库的commit id更新至最新,fetch不会改变代码,如果想使代码更新,需要使用git merge o ...
- [Git] Git fetch和git pull的区别
reference : http://blog.csdn.net/hudashi/article/details/7664457 Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git ...
- git fetch 和 git pull 的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令: 1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge git fetch origin master git log ...
随机推荐
- (转) ICML2016 TUTORIAL参会分享
ICML2016 TUTORIAL参会分享 本文转自: https://mp.weixin.qq.com/s?__biz=MzI3MDE4NTk4MQ==&mid=2658399541& ...
- 使用swiper和吸顶效果代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- 开启自启动oracle和实例
第一步在/etc/rc.d/rc.local中添加下列信息#启动oraclesu - oracle -c '/u01/app/oracle/product/11.2.0/db_1/bin/dbstar ...
- threading模块和queue模块实现程序并发功能和消息队列
简介: 通过三个例子熟悉一下python threading模块和queue模块实现程序并发功能和消息队列. 说明:以下实验基于python2.6 基本概念 什么是进程? 拥有独立的地址空间,内存,数 ...
- SVG ViewBox
如果svg图形太大或者太小,就可以用ViewBox属性来调整在页面中的显示范围.大小. "像素不能直接换算成英寸.厘米,要在 dpi ( dot per inch 分辨率,概念较多,鼠标 d ...
- linux服务之httpd
http://mirrors.cnnic.cn/apache/httpd/docs/ 英文pdf文档下载 Apache HTTP Project’s goal It is the Apache HTT ...
- linux包-下载-curl与wget
[root@localhost ~]# rpm -qa|grep curllibcurl-7.19.7-37.el6_4.x86_64python-pycurl-7.19.0-8.el6.x86_64 ...
- XMLHttpRequest 对象
XMLHttpRequest 对象 XML XSLTXML 解析器XMLHttpRequest 对象用于在后台与服务器交换数据. 什么是 XMLHttpRequest 对象? XMLHttpReque ...
- react相关知识点
1.react内联样式写法: <div style={{width:'200px',height:'100px',border:'1px solid red'}}> </div> ...
- JAVA:借用OpenOffice将上传的Word文档转换成Html格式
为什么会想起来将上传的word文档转换成html格式呢?设想,如果一个系统需要发布在页面的文章都是来自word文档,一般会执行下面的流程:使用word打开文档,Ctrl+A,进入发布文章页面,Ctrl ...