问题描述
我必须Git仓库repo1
和repo2
. repo1
中有三个分支master
,alpha
和beta
. repo2
从repo1
克隆.
I have to Git repos repo1
and repo2
. There are three branches master
, alpha
and beta
in repo1
. repo2
clones from repo1
.
在repo2
中,我可以看到带有git branch -a
的远程跟踪分支:
In repo2
, I can see remote tracking branches with git branch -a
:
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/alpha
remotes/origin/beta
但是repo2
中的文件夹.git/refs/remotes/origin/
只有一个文件HEAD
,其内容为:
But the folder .git/refs/remotes/origin/
in repo2
only has a single file HEAD
, whose content is:
ref: refs/remotes/origin/master
因此,此HEAD
是符号引用.但是为什么它指向不存在的引用呢?顺便说一句,repo2
在何处存储alpha
和beta
的信息? (repo2
知道alpha
和beta
,因为它在git branch -a
中显示它们.)
So this HEAD
is a symbolic ref. But why does it point to a ref that doesn't exist? BTW, where does repo2
store the information of alpha
and beta
? (repo2
knows alpha
and beta
because it displays them in git branch -a
.)
推荐答案
引用可能已打包"在.git/packed-refs
中.
The refs are probably "packed" in .git/packed-refs
.
这篇关于Git在哪里存储远程跟踪分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!