我正在尝试按照此处的教程说明进行操作:https://rtyley.github.io/bfg-repo-cleaner/
我使用 --mirror 克隆了基于 github 的存储库的新副本
我按照说明运行 bgf 和 reflog
我的本地存储库现已删除了大博客。太棒了。
当我去推回 github 时,我得到
To github.com:interstar/myproject.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="03646a7743646a776b76612d606c6e" rel="noreferrer noopener nofollow">[email protected]</a>:interstar/myproject.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
所以我尝试从 github 进行 git pull 以确保同步。 (尽管这个存储库是在流程开始时从 github 干净克隆的)
它会拉下我想要摆脱的所有 Blob 。所以我的存储库恢复到之前的大小。
所以我再次运行 bfg 和 reflog。不错的小仓库。
尝试推回github
同样的错误消息。
我错过了什么?
最佳答案
好的。
我解决了这个问题。这是我自己的愚蠢错误,但留下这个问题以防其他人做同样的事情。
虽然我第一次从 github 克隆存储库时使用了 --mirror,但在某些时候我再次尝试并忘记使用 --mirror 选项。
当我重新使用该选项时,它按照教程的建议工作。
关于git-rewrite-history - BFG-repo-cleaner 并推送回 GitHub,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61900790/