我的.git / refs / heads / master文件在哪里 [英] Where is my .git/refs/heads/master file
问题描述
我在下面的文章中了解一些关于git内部的知识。
http://git-scm.com/book/en/v2/Git-Internals-Git-References
它表示git存储对 .git / refs / heads
目录中每个分支的最新提交对象的引用。
在我的一个git仓库中,我发现 .git / refs / heads
目录中没有任何内容。我检查过的所有其他存储库包含存储库中每个分支的文件。
该存储库中存在 .git / refs / heads $ c $
有人可以解释为什么 .git / refs / heads
是空的,并且git在这种情况下如何在没有问题的情况下工作?
git pack-refs
将把它们全部放入 packed-refs
文件。 存储库布局
和 core commands 的地区,另外,请参阅底部的另请参阅链接。你也应该能够得到那些 git help
,我希望没有任何发行版可以省略文档。 I am following below article to get some idea of internals of git.
http://git-scm.com/book/en/v2/Git-Internals-Git-References
It says that git stores references to latest commit objects of each branch in .git/refs/heads
directory.
In one of my git repositories, I found that there's nothing in .git/refs/heads
directory. All other repositories I checked contain files for each branch in the repository.
This repository with empty .git/refs/heads
actually has a master branch and it works perfectly.
Can someone explain why.git/refs/heads
is empty and how git works without a problem in this condition?
Then there's going to be a file named .git/packed-refs
there too. When repository histories start getting really long, having hundreds of tags starts to slow things down, so git pack-refs
will put them all in the packed-refs
file.
Yay for going after the internals, you're going to be floored by how simple it is. It's usually worthwhile reading whatever docs come with a tool, you're in repository layout
and core commands territory, plus, see the "see also" links at the bottom. You should also be able to get those with git help
, I hope there's no distribution that omits the docs.
这篇关于我的.git / refs / heads / master文件在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!