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. Python 集成开发环境(IDE)

      DiscoverSDK网站进行了一次调查 - 什么是最好的Python IDE,这里是调查的结果 ​​​Python是一种非常流行的开源编程语言.得益于无尽的模块选项,Python今天广泛用于脚本 ...

  2. nginx 配置静态目录 访问bootstrap

    location /static/ { alias /Users/wangziqiang/djangoprojects/bpmTest/static/; } 注意  /static/   中 /的完整 ...

  3. C# 的概念

    1,C#-ASP.NET C# 的概念 2,Intro ASP.NET 一,基本概念: 1,C#--语言 microsoft 开发的纯面向对象的语言,是VS2005的主流开发语言. 语言的发展 C-- ...

  4. TensorFlow笔记五:将cifar10数据文件复原成图片格式

    cifar10数据集(http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz)源格式是数据文件,因为训练需要转换成图片格式 转换代码: 注意文件路 ...

  5. 解决Linux下AES解密失败

    前段时间,用了个AES加密解密的方法,详见上篇博客AES加密解密. 加解密方法在window上測试的时候没有出现不论什么问题.将加密过程放在安卓上.解密公布到Linuxserver的时候,安卓将加密的 ...

  6. 基于Wiremock创建Mock Service平台

    转载:http://blog.csdn.net/liuchunming033/article/details/52399397 1.Wiremock工具介绍 一般开发项目都会分模块进行,比如都会把前端 ...

  7. mysql数据库管理工具(navicat for mysql)

    Navicat Premium 是一个可多重连接的数据库管理工具,它可让你以单一程序同时连接到 MySQL.Oracle.PostgreSQL.SQLite 及 SQL Server 数据库,让管理不 ...

  8. Openstack nova代码部分凝视一

    做个一个没怎么学过python的菜鸟.看源代码是最好的学习方式了,如今就从nova入手,主要凝视一下 nova/compute/api.py 中的 create_instance函数 def _cre ...

  9. poj1691--Painting A Board(拓扑+dfs)

    题目链接:点击打开链接 题目大意:一个矩形由n个小矩形组成,如今要给小矩形染色,可是颜料会向下滑,为了防止弄乱颜料,所以要先染上面的矩形,后然染以下的矩形.每一次改变颜色都要用一个新的刷子.问最小用多 ...

  10. ps快捷键记录

    alt+delete  前景色填充 ctrl+delete  背景色填充 alt+shift+鼠标调节  变换选取,做圆环 ctrl+t  自由变换 alt+鼠标拖动  快捷复制某区域 delete ...