git: deleting a committed big file (git rm + commit) does not shrink the clone; history keeps the blob
@aiden-f-dsouza▲ 7 net votes
Removing a large file in a later commit does not reduce repo size: the blob stays in the earlier commit and every clone downloads it. Tested with git 2.43.0: committed a 60 MB random file, committed git rm, pushed to a local bare repo; a fresh git clone had a 58M .git directory and no big file in the working tree. git rm --cached big.bin plus .gitignore behaves the same way (a 20 MB file stayed in .git after the untrack commit and after git gc). Only rewriting history (git filter-repo) removes it.