TortoiseGit - pull 与 fetch

Git的Pull其实是fetch与Merge两个命令的合并。

平时遇到的问题是,在本地分支进行了一些修改,准备提交。但是怕提交前有其他人push了新的代码。于是想在提交前,看看远程仓库上的log。这时候,只要fetch下来,就可以看到远程仓库的更新。

1) 未 fetch 之前,本地 master 分支的头指针与 remote/origin/master 分支的头指针指向是同一个位置

2)  右键菜单 –> fetch

可以看到有 fetch 到更新到本地仓库

2) 本地查看 log, 可以看到此时只有 master 的头指针,已经看不到remote的指针了。

此时,点击左上角的master,并点击选中 remotes/origin/master 分支

这样便可以看到 remotes/origin/master 分支的头指针,跟本地的 master 分支头指针并不在一个位置了。

3) 把 origin/master 分支合并到 本地的master

右击 origin/master 的标签,选择 Merge to “master”…

完成 Merge 操作后,可以看到 Merge 的信息,有两个文件进行了修改。

时间: 2024-08-06 18:13:14

TortoiseGit - pull 与 fetch的相关文章

Git中pull对比fetch和merge

本文参考于:http://www.zhanglian2010.cn/2014/07/git-pull-vs-fetch-and-merge/ 使用git fetch和git pull都可以更新远程仓库的代码到本地,但是它们之间还是有区别 git fetch git fetch origin master git log -p master..origin/master git merge origin/master 从远程的origin仓库的master主分支更新最新的版本到origin/mas

Git 少用 Pull 多用 Fetch 和 Merge(转)

英文原文:git: fetch and merge, don’t pull This is too long and rambling, but to steal a joke from Mark Twain Blaise Pascal I haven’t had time to make it shorter yet.  There is some discussion of this post on the git mailing list, but much of it is tangen

Git 少用 Pull 多用 Fetch 和 Merge(转)

This is too long and rambling, but to steal a joke from Mark Twain Blaise Pascal I haven’t had time to make it shorter yet.  There is some discussion of this post on the git mailing list, but much of it is tangential to the points I’m trying to make

第二章-第二题(每人自己建立一个HelloWorld项目,练习使用git的add/commit/push/pull/fetch/clone等基本命令。比较项目的新旧版本的差别。)--by侯伟婷

第二题:每人自己建立一个HelloWorld项目,练习使用git的add/commit/push/pull/fetch/clone等基本命令.比较项目的新旧版本的差别. 下面我将自己的练习结果和个人感受记录如下: 第一步:安装Git,设置自己的账号和邮箱,参见Git教程-廖雪峰的官方网站,网址如下参考资料1所示. 第二步:在Git中新建repository,名叫HelloWorld,并进行初始化,如图所示. 第三步:在HelloWorld版本库中新建了helloWorld.txt文件,用以练习G

git fetch和git pull之间的区别--转载

原文地址:http://blog.csdn.net/a19881029/article/details/42245955 git fetch和git pull都可以用来更新本地库,它们之间有什么区别呢? 每一个本地库下都有一个.git的隐藏文件夹,文件夹中的文件保存着跟这个本地库相关的信息 首先来看下其中的config文件 [plain] view plaincopy [core] repositoryformatversion = 0 filemode = false bare = false

git fetch, merge, pull, push需要注意的地方

在git操作中,我们经常会用到fetch, merge, pull和push等命令,以下是一些我们需要注意的地方. 给大家准备了参考资料: 1. What?s a Fast Forward Merge?:https://sandofsky.com/images/fast_forward.pdf 2. Understanding the Git Workflow:https://sandofsky.com/blog/git-workflow.html 3. Understanding Git: M

get merge --no-ff和git merge区别、git fetch和git pull的区别

get merge --no-ff和git merge区别 git merge –no-ff可以保存你之前的分支历史.能够更好的查看 merge历史,以及branch 状态. git merge则不会显示 feature,只保留单条分支记录. git fetch和git pull的区别 git pull=git fetch+git merge 原文地址:https://www.cnblogs.com/diffx/p/11572253.html

git fetch & pull详解

1.简单概括 先用一张图来理一下git fetch和git pull的概念: 可以简单的概括为: git fetch是将远程主机的最新内容拉到本地,用户在检查了以后决定是否合并到工作本机分支中. 而git pull 则是将远程主机的最新内容拉下来后直接合并,即:git pull = git fetch + git merge,这样可能会产生冲突,需要手动解决. 下面我们来详细了解一下git fetch 和git pull 的用法. 2.分支的概念 在介绍两种方法之前,我们需要先了解一下分支的概念

git 学习(git fetch/ git pull/ git rebase/ git cherry-pick的区别)

使用git做开发管理: 1. Git clone  将远程代码克隆到本地: 2. Git branch  查看本地branch (git clone 时会创建 master) 3. git branch -a  查看本地和远程分支:(远程分支包括 remotes/origin/master 远程master分支) 4. Git remote -v 查看远程库对应的简短名称 (origin  ...) 5. Git checkout -b bug origin/master 创建本地开发分支 6.