是"refs/heads/master"吗?与"refs/remotes/origin/master"相同.在Git中? [英] Is "refs/heads/master" same as "refs/remotes/origin/master" in Git?

查看:321
本文介绍了是"refs/heads/master"吗?与"refs/remotes/origin/master"相同.在Git中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题很简单:refs/heads/masterrefs/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的跟踪分支,因为origingit 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆