git fetch和git pull之间的区别
git fetch和git pull都可以用来更新本地库,它们之间有什么区别呢? 每一个本地库下都有一个.git的隐藏文件夹,文件夹中的文件保存着跟这个本地库相关的信息 首先来看下其中的config文件 [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly [remote "origin" ] url = git@github. com: seanzou88/fetch.git fetch = +refs/heads/* :refs/remotes/origin/* [branch "master" ] remote = origin merge = refs/heads/master 从这个文件中我们可以了解到: 1,本地库的当前分支为master,其关联的远程库名称为origin(不同的名称可以指向同一个远程库,参见git remote命令) 2,远程库origin所在的位置为(URL):git@github.com:seanzou88/fetch.git 然后可以查看.git文件夹下的HEAD文件: ref : refs/heads