如何使用不在工作树中的提交清洁git存储库 [英] How clean git repository with commit which not in work tree

查看:66
本文介绍了如何使用不在工作树中的提交清洁git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用bfg清理了Git存储库(Bitbucket云),但是最后一次提交仍未清理(如bfg文档中所述:默认情况下,BFG不会修改主服务器(或HEAD)上最新提交的内容')分支,即使它会清除之前的所有提交.).

I cleaned the Git repository (Bitbucket cloud) with bfg, but the last commit remained uncleaned (as written in the bfg documentation: By default the BFG doesn't modify the contents of your latest commit on your master (or 'HEAD') branch, even though it will clean all the commits before it.).

但是,我没有看到它,而是想在Bitbucket中运行git gc.
为此,我执行了"git reset --hard HEAD",然后回滚到了它,然后又返回了"git push --force".
但是存储库的大小增加了吗?!

However, I didn’t see it and wanted to run git gc in a Bitbucket.
For this I did "git reset --hard HEAD" and rolled back to it then "git push --force".
But repository size increased?!

现在,我已经使用了存储库中的旧历史记录进行了此提交,而bfg无法清除它,我该怎么办?
由于它不再连接到工作树上,我该如何删除它?

Now I have this commit with the old history left in the repository, and bfg cannot clean it, what should I do?
How can I remove it, since it is no longer attached to the working tree?

推荐答案

我在bitbucket支持中编写了代码,他们在服务器上运行了脚本"git gc",并且清除了旧的故事

I wrote in bitbucket support, they ran the script "git gc" on server and the old story was cleaned

这篇关于如何使用不在工作树中的提交清洁git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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