Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何清理git工件?_Git_Storage_Data Cleaning_Nodegit - Fatal编程技术网

如何清理git工件?

如何清理git工件?,git,storage,data-cleaning,nodegit,Git,Storage,Data Cleaning,Nodegit,我正在做一个使用nodegit存储数据的项目。每个用户都可以创建一个租户[对文档进行分组的命名空间]并处理租户中的文档。创建租户时,我们将使用租户名称创建git回购。当用户向文档添加内容时,将创建blob,构建git树,创建commit以指向该树,并使用文档名称的引用指向最终提交。对于读取流,使用文档名读取引用,并使用树获取与文件关联的blob 我需要定期清理与文档关联的工件。这对于git意味着什么。我假设我不能简单地删除与提交相关联的所有blob,因为git是内容可寻址的,并且可能有其他文档引

我正在做一个使用nodegit存储数据的项目。每个用户都可以创建一个租户[对文档进行分组的命名空间]并处理租户中的文档。创建租户时,我们将使用租户名称创建git回购。当用户向文档添加内容时,将创建blob,构建git树,创建commit以指向该树,并使用文档名称的引用指向最终提交。对于读取流,使用文档名读取引用,并使用树获取与文件关联的blob


我需要定期清理与文档关联的工件。这对于git意味着什么。我假设我不能简单地删除与提交相关联的所有blob,因为git是内容可寻址的,并且可能有其他文档引用同一blob。向git垃圾收集器发出文档不再使用blob集的信号的最佳方式是什么?有没有更好的方法来清理与文档相关的工件?

什么意思,您需要清理工件?什么文物?Git将自己运行gc。它将垃圾收集任何无法从refs(或reflog)访问的内容。那么你还想向它发出什么信号呢?