“git clone ...”之后的提交对象在哪里?

发布于 2024-12-12 04:21:00 字数 272 浏览 0 评论 0原文

在输入 git clone后,我看到 .git/refs/heads/master 是使用 SHA1_code 创建的。

虽然我看到 SHA1_code 指向一个提交对象(通过输入 git cat-file -t SHA1_code),但我在 .git 中找不到这个提交对象/对象

这个提交对象在哪里?

After I typed git clone <path to project> I see that .git/refs/heads/master was created with SHA1_code inside.

Though I see that SHA1_code points to a commit object (by typing git cat-file -t SHA1_code), I couldn't find this commit object in .git/objects.

Where is this commit object ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半寸时光 2024-12-19 04:21:00

它可能在一个包中

请参阅 Packfiles (Pro Git Chapter 9-4) 详细了解git对象数据库

Git 在磁盘上保存对象的初始格式称为松散对象格式。然而,Git 有时会将其中几个对象打包到一个称为 packfile 的二进制文件中,以节省空间并提高效率。如果周围有太多松散对象、手动运行 git gc 命令或者推送到远程服务器,Git 就会执行此操作。要查看会发生什么情况,您可以通过调用 git gc 命令手动要求 Git 打包对象:

It's probably in a pack

Refer to Packfiles (Pro Git Chapter 9-4) to learn more about the git object database

The initial format in which Git saves objects on disk is called a loose object format. However, occasionally Git packs up several of these objects into a single binary file called a packfile in order to save space and be more efficient. Git does this if you have too many loose objects around, if you run the git gc command manually, or if you push to a remote server. To see what happens, you can manually ask Git to pack up the objects by calling the git gc command:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文