I wanted to use git-lfs to add a large binary into my git repository but that failed:
$ git add large-file.tar.xz
So I unstage the file
$ git checkout -- large-file.tar.xz
$ git status
On branch lfs
nothing to commit, working tree clean
But the git still use up the disk space for the large file.
$ du -sh .git
101M .git
Reclaiming the space
I tried using the BFG repo cleaner to remove the blob, but nothing is found. (Yes, BFG only scan for existing commits, but I was desperate)
$ bfg --strip-blobs-bigger-than 10M .
Using repo :path/to/project
Scanning packfile for large blobs: 725
Scanning packfile for large blobs completed in 31 ms.
Warning : no large blobs matching criteria found in packfiles - does the repo need to be packed?
git gc does not work as well
$git reflog expire --expire=now --all && git gc --prune=now --aggressive
$ du -sh .git
101M .git
