我的.git / refs / heads / master文件在哪里 [英] Where is my .git/refs/heads/master file

查看:324
本文介绍了我的.git / refs / heads / master文件在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的文章中了解一些关于git内部的知识。

http://git-scm.com/book/en/v2/Git-Internals-Git-References



它表示git存储对 .git / refs / heads 目录中每个分支的最新提交对象的引用。



在我的一个git仓库中,我发现 .git / refs / heads 目录中没有任何内容。我检查过的所有其他存储库包含存储库中每个分支的文件。



该存储库中存在 .git / refs / heads

有人可以解释为什么 .git / refs / heads 是空的,并且git在这种情况下如何在没有问题的情况下工作?

然后,将会有一个名为<$ c $的文件c> .git / packed-refs 。当版本库历史开始变得很长时,有数百个标签开始减慢速度,所以 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屋!

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