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
11k stars 547 forks source link

'git push --all --force' after deleting large file(s) returning Everything up-to-date #278

Open atoy3731 opened 6 years ago

atoy3731 commented 6 years ago

I've confirmed that bfg-repo-cleaner works on my local repo for removing a large file from the Git history of a project, but when I try to push it back to the remote, it tells me everything is up-to-date so it doesn't actually push the change and remove the large file.

Before running bfg, I executed this one-liner (thanks, Stack Overflow) to find the large file:

git gc && join -e ERROR -a 2 -j 1 -o 2.1,2.3,1.2 --check-order <( git rev-list --objects --all | sort -k 1 ) <( git verify-pack -v .git/objects/pack/pack-*.idx | gawk '( NF == 5 && $2 == "blob" ){print}' | sort -k1 ) | sort -k2gr

This yielded the large file I was trying to get rid of at the top:

155dc8e187de53daa2eb2e8c3d68a296a3b7d189 288750811 dist/largefile.tar.gz

Then I executed the bfg/follow-up commands:

java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 100M
git reflog expire --expire=now --all && git gc --prune=now --aggressive

Lastly, I execute that same command from above to confirm the file is gone and it is. Mission accomplished I'd think, but when I do a git push --force --all, it says everything is up-to-date and there is nothing to push:

$ git push --force --all
Everything up-to-date

Any ideas?

javabrett commented 6 years ago

This sounds more like a post-BFG problem - did you try asking on StackOverflow? What system is your remote? Did you follow all the instructions for cloning etc.?

JESii commented 6 years ago

Or maybe it wasn't cloned with the --mirror option into a separate directory to do the work?

g3kk0 commented 1 year ago

Just had a very similar issue to this and the fix was to use an older version of git.

git 2.39.2 - works
git 2.41.0 - broken (results in 'Everything up-to-date' and nothing being pushed)