起源/头部分支的用途是什么? [英] What is the use of the origin/HEAD branch?
问题描述
可能存在重复:
Git中的HEAD和ORIG_HEAD
默认情况下,我们在git中看到两个分支:
origin / master
origin / HEAD
我在想,头是用来做什么的?
HEAD
是一个符号引用(类似于符号链接),指向您所在的分支。你可以使用git symbolic-ref HEAD
来获取它指向的引用。如果您切换分支(例如git checkout branch1
),HEAD
将指向该分支。这存储在.git
中的文件中,如.git / HEAD
。
master
是您可以使用的本地分支。如果您克隆存储库或启动新的存储库,通常会使用默认值。
$ b $origin / master
是master的位置
分支在远程
称为原点
。Possible Duplicate:
HEAD and ORIG_HEAD in GitBy default we see two branches in git:
origin/master origin/HEAD
I wonder, what is head used for?
解决方案
HEAD
is a a symbolic reference (similar to a symbolic link) that points to the branch you're on. You can get the reference it points to usinggit symbolic-ref HEAD
. If you switch branches (e.g.git checkout branch1
),HEAD
will point to that. This is stored in a file in.git
as.git/HEAD
.
master
is a local branch that you can work on. It's usually the default if you clone a repository or start a fresh one.
origin/master
is the location of themaster
branch on theremote
calledorigin
.这篇关于起源/头部分支的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!