rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.83k stars 535 forks source link

remote rejected with deny updating a hidden ref when run git push #484

Open Happy-ArthurYang opened 1 year ago

Happy-ArthurYang commented 1 year ago

I run this with jdk 11 with the latest version of bfg-1.14.0.jar bug with error whrn run git push image

Also attached the report. decodr.git.bfg-report.zip

echonax07 commented 1 year ago

I am also facing the same issue with gitlab. I disabled the branch protection as well but still the same error.

any help would be greatly appreciated, thanks

Happy-ArthurYang commented 1 year ago

you can try to remove your local repo and clone it again, and the size did change to smaller. so the push should have some effect.

joihn commented 1 year ago

same issue for me, I'm also a gitlab user. despite the error, It seem the cleaned item have been pushed to the remote, but I'm still suspsicious about the error message.

cocoonkid commented 9 months ago

Same issue here as gitlab user. I disabled the branch protection as well but still the same error.


╰─λ bfg --delete-files "MAosA.zip project.git

Using repo : /home/cocoonkid/Documents/tmp/project.git

Found 2050 objects to protect
Found 6 commit-pointing refs : HEAD, refs/heads/dev, refs/heads/development, ...

Protected commits
-----------------

These are your protected commits, and so their contents will NOT be altered:

 * commit f89d2720 (protected by 'HEAD')

Cleaning
--------

Found 208 commits
Cleaning commits:       100% (208/208)
Cleaning commits completed in 92 ms.

BFG aborting: No refs to update - no dirty commits found??

The file is also still visible in the repo in the specific commit. But bfg does not even find it.

I followed the instructions to the dot.

doliG commented 8 months ago

Same issue here when trying a dry run on a sandbox repo, please maintainer can you help on what should we do when we encounter this error ?

From my understanding this is because GitHub/GitLab still has references to the old commits in any pull requests. Even though BFG has rewritten the commits, GitHub still has read-only refs for the old commits in pull requests.

To resolve this, I found a couple options:

doliG commented 8 months ago

Please contributors have a look at the OP of this one. This is an interessing problem worth to explain / mention in the doc and BFG's website (imho).

@rtyley @javabrett @dwijnand

Also this repo needs a bit of triage in the issue, a spammer spawned few days ago..