是"refs/heads/master"吗?与"refs/remotes/origin/master"相同.在Git中? [英] Is "refs/heads/master" same as "refs/remotes/origin/master" in Git?
问题描述
问题很简单:refs/heads/master
与refs/remotes/origin/master
是一样的东西吗?如果在某些情况下不是,那么我怎么知道什么时候不知道什么呢?
The question is simple: is refs/heads/master
the same thing as refs/remotes/origin/master
? If it is not in some cases, how can I know when it is not and what it is then?
推荐答案
它们是两个不同的符号名称,可以指向不同的事物. refs/heads/master
是工作副本中名为master
的分支.通常,这是refs/remotes/origin/master
的跟踪分支,因为origin
是git clone
创建的远程服务器的默认名称,并且其主要分支通常也称为master
.
They are two different symbolic names that can point to different things. refs/heads/master
is a branch in your working copy named master
. Frequently that is a tracking branch of refs/remotes/origin/master
because origin
is the default name for the remote created by git clone
and its primary branch is usually also named master
.
您可以使用git rev-list refs/heads/master..refs/remotes/origin/master
看到它们之间的差异,如果它们相同,则为空,否则将列出它们之间的提交.
You can see the difference between them with git rev-list refs/heads/master..refs/remotes/origin/master
which will be empty if they are the same and will otherwise list the commits between them.
这篇关于是"refs/heads/master"吗?与"refs/remotes/origin/master"相同.在Git中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!