本文介绍了Git在哪里存储远程跟踪分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须Git仓库repo1repo2. repo1中有三个分支masteralphabeta. repo2repo1克隆.

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在何处存储alphabeta的信息? (repo2知道alphabeta,因为它在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在哪里存储远程跟踪分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 20:53