BFG Repo-Cleaner指出我的github存储库不是有效的Git存储库

BFG Repo-Cleaner states my github repo is not a valid Git repository

这是关于Stackoverflow的上一个问题的后续问题。

我尝试从本地git历史记录中删除大文件,但是此问题中建议的工具(BFG Repo-Cleaner)指出我的私有GitHub存储库不是有效的git存储库。

我使用的命令是:

1
java -jar bfg-1.12.12.jar  --strip-blobs-bigger-than 99M https://github.com/name/repo.git

最终会导致:

1
Aborting : https://github.com/name/repo.git is not a valid Git repository.

我找不到解决方案。该工具与私有或https GitHub存储库不兼容吗?

如何使用替代工具git-filter-branch从本地git历史记录中删除所有大于99MB的文件?

该项目的大小约为6MB,到目前为止,仅完成了约50次提交,没有其他人对此进行任何工作。


您已经为该工具提供了GitHub URL,但是他们网站上的用法部分说您应该使用存储库的本地副本进行操作:

Usage

First clone a fresh copy of your repo, using the --mirror flag:

1
$ git clone --mirror git://example.com/some-big-repo.git

This is a bare repo, which means your normal files won't be visible, but it is a full copy of the Git database of your repository, and at this point you should make a backup of it to ensure you don't lose anything.

Now you can run the BFG to clean your repository up:

1
$ java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git

该页面上还有很多其他好的内容;我建议您先阅读全文,然后再试。


我已使用以下命令修复了此问题:

步骤1

1
cd some-big-repo.git

步骤2

1
java -jar path/bfg.jar --strip-blobs-bigger-than 100M

如果您位于repo目录中,则无需明确提及回购名称,它会自动检测回购并执行其工作。


您应该记住,使用git,您对历史记录所做的所有操作都必须在本地完成。然后,一旦满意,就可以通过推送到远程存储库来发布。

因此,在这里您必须提供通往本地存储库的路径...