1 about "origin/master tracks the remote branch"

1.1 what does tracking mean?

after "git clone", local "master" branch atomatically tracks the remote "origin/master" branch. thus, "git pull master" will fetch the "origin/master" branch it tracks and merge the data to itself. If no such tracking relationship, when we pull, we should use "git pull <远程主机名> <远程分支名>:<本地分支名>".

1.2 what is the remote branch?

it is the branch in the server. We use it to fetch the other's commits.

1.3 if the remote branch receives a commit, what is the effect to "origin/master"

if you don't fetch, the local "origin/master" will not change. but if you fetch, "origin/master" will point to the newest commit on the server.

1.4 what is the "origin/master" branch?

It is a remote branch. "origin" is the default remote repository's name, and master is the default branch name of the remote branch.

We fetch the "origin/master" to get the codes commited by the others. Thus, we need this remote branch.

2 difference between git pull and git fetch

2.1 git pull

fetch the new data from the server and merge it with the specified branch.

git fetch

only fetch the new data from the server, but not merge. the data is stored in the local repository, but not merged into the current branch. and the data will no dirty the working copy.

he take away is to keep in mind that there are often at least three copies of a project on your workstation. One copy is your own repository with your own commit history. The second copy is your working copy where you are editing and building. The third copy is your local "cached" copy of a remote repository.

special points about git的更多相关文章

  1. Git - Tutorial官方【转】

    转自:http://www.vogella.com/tutorials/Git/article.html#git_rename_branch Lars Vogel Version 5.8 Copyri ...

  2. git版本控制管理实践-2

    给网站设置一个 "根目录下的logo.ico", 还是很有必要的,比如赶集网,这时在 "历史"搜索时, 就可以根据 网站的 logo.ico 很轻松的就能够找到 ...

  3. git设置hooks 钩子

    github是可以设置hooks的,看:在设置webhooks & services,可在Just the push event.是设定向你的服务器发请求,然后再做相应的处理. https:/ ...

  4. Using Git Submodules

    NOTE: Following content is directly reprinted from http://patrickward.com/2013/01/09/using-git-submo ...

  5. [Git] Automatically running tests before commits with ghooks

    Wouldn't it be nice if everyone ran the tests before committing code? With ghooks, you can automatic ...

  6. git第一篇---基本命令

    摘要: (1)用git而不是svn.分布式而不是集中式 (2)名词解释 origin是父目录的意思,master是 一个特殊的分支而已.具体参看做最下边: 1.创建仓库 mkdir git cd gi ...

  7. 如果非得了解下git系统... - 实践篇

    git的定义是一个内容寻址文件系统.内容.寻址.文件.系统,该来的总会来的… 本文旨在通过实践来介绍.git文件夹中的目录及文件功能,属git基础知识.但在此基础上可解决各git使用过程中可能遇到的问 ...

  8. Git Command之Code Review

    原文链接 准备 Step 1. Create a team and add a teammate Step 2. Create a repository with some content 应用 Cl ...

  9. ZOJ2314 Reactor Cooling

    Reactor Cooling Time Limit: 5 Seconds      Memory Limit: 32768 KB      Special Judge The terrorist g ...

随机推荐

  1. luogu P1345 [USACO5.4]奶牛的电信Telecowmunication

    https://www.luogu.org/problemnew/show/1345 拆点,中间建流量为1的边,跑最小割 #include<cstdio> #include<queu ...

  2. 363. Max Sum of Rectangle No Larger Than K

    /* * 363. Max Sum of Rectangle No Larger Than K * 2016-7-15 by Mingyang */ public int maxSumSubmatri ...

  3. Mac测试模拟慢网速

    先普及一下Kb,KB,Kbps,Mb,Mbps等一些列概念 1Byte = 8bit 1KB (Kilobyte 千字节)=1024Byte 1MB (Megabyte,兆字节,简称“兆”)=1024 ...

  4. 【redis】java操作redis时,StringRedisTemplate的expire()方法的作用,什么时候使用

    java操作redis时,StringRedisTemplate的expire()方法的作用,什么时候使用 //重新设置过期时间为30分钟,刷新时间 redisTemplate.expire(MsOp ...

  5. Android requestLayout 和 invalidata , postInvalidate 比较

    Android 中的View更新方法 invalidate 在UI线程中使用. postInvalidate 在非UI线程中通知重绘. View 确定自身已经不适合现有区域时,调用requestLay ...

  6. VS2010 MFC中 在FormView派生类里获取文档类指针的方法

    经过苦苦调试,今晚终于解决了一个大问题. 我想要实现的是:在一个FormView的派生类里获取到文档类的指针. 但是出现问题:试了很多办法,始终无法获取到. 终于,此问题在我不懈地调试加尝试下解决了. ...

  7. selenium firefox46.0.1设置禁用图片

     firefox_profile = webdriver.FirefoxProfile()firefox_profile.set_preference('permissions.default.ima ...

  8. NVIDIA® Quadro® 四路缓冲 3D立体方案

    http://www.nvidia.cn/object/quadro_pro_graphics_boards_cn.html NVIDIA® Quadro® 专业显卡让地球学家以及时装设计师等许多专业 ...

  9. linux中at命令

    名称 : linux at命令 使用权限 : 所有使用者 使用方式 : at -V [-q queue] [-f file] [-mldbv] TIME 说明 : linux at命令可以让使用者指定 ...

  10. Java数据结构-线性表之静态链表

    静态链表的定义: 节点由一个一维数组和一个指针域组成,数组用来存放数据元素,而指针域里面的指针(又称游标)用来指向下一个节点的数组下标. 这种链表称之为静态链表. 链表中的数组第一个和最后一个位置须要 ...