什么是“松散物体” Git GUI指的是? [英] What are the "loose objects" that the Git GUI refers to?

查看:93
本文介绍了什么是“松散物体” Git GUI指的是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开 Git GUI 时,会收到一个弹出消息,指出松散对象

什么是松散对象 code>和我怎么能防止这种情况再次发生?

解决方案

一个对象(blob,树和提交)与SHA说 - 810cae53e0f622d6804f063c04a83dbc3a11b7ca将存储在

  .git / objects / 81 / 0cae53e0f622d6804f063c04a83dbc3a11b7ca 

(为了提高文件系统的性能,将前两个字符拆分为现在不是所有的对象都存储在同一个目录中)



存储在上面的对象称为松散对象。



当您开始使用回购时,对象。随着数字越来越高,它变得效率低下,并且它们被存储在一个包文件中。

  git gc 

就是你运行包装对象的东西(通常,不需要的和几个星期前的松散对象也会被删除,而 - prune =< date> 选项,您可以强制删除不再需要的松散对象,就像您修改提交时一样。旧的提交对象不再需要。)


When I open the Git GUI, I get a popup message that refers to loose objects. I did git gc and that removed the message.

What are loose objects and how could I prevent this from occurring again?

解决方案

An object (blobs, trees, and commits) with SHA say - 810cae53e0f622d6804f063c04a83dbc3a11b7ca will be stored at

.git/objects/81/0cae53e0f622d6804f063c04a83dbc3a11b7ca

( the split in first two characters to improve performance of the File system as now not all the objects are stored in the same directory)

Objects stored as above are referred to as Loose objects.

When you start up with your repo, you mostly have loose objects. As the number goes high, it becomes inefficient and they are stored in a pack file. Such objects are called packed objects.

 git gc

is what you run to pack objects (Usually loose objects that are not needed and few weeks old are also removed and with --prune=<date> option you can force remove loose objects that are no longer needed. Like when you amend a commit. The old commit object is no longer needed. )

这篇关于什么是“松散物体” Git GUI指的是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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