2

Recently, I accidentally added some very large files to my GIT repo and pushed them to the server. Luckily, I was able to recursively remove these files from the repo, so they're not downloaded anymore on a new git clone, using the following guide: http://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery

I've tested this solution by doing a new clone in a new folder, and the large files are completely gone. On my GIT server, however, in the /var/git/objects/pack folder, there is one very large pack file. Presumably, this is the faulty commit. Is there anyway to get rid of this file?

1 Answer 1

2

Found it! Executing

git gc

on the server removed unnecessary pack files (garbage collection). Additionally,

git reflog expire --expire=now --all
git prune

removed unnecessary objects.

Not the answer you're looking for? Browse other questions tagged or ask your own question.