tags:

views:

361

answers:

1

I committed a bunch of large images to a git repo by accident and it slowed things to a crawl. I removed the images but doing a checkout still takes forever and the .git file is 300+MB. It looks like the .pack files are huge.

Is there any way to clean this up?

thanks

+2  A: 

If you make such a commit but haven't pushed your changes to any other repository, then it's easy to get rid of it with git-rebase or the more powerful git-filter-branch. However, it sounds like you have already pushed these big files upstream.

If these changes have already been shared among many different repositories, especially those that have had further work applied to them, then this might be difficult to clean up without causing disruption. If the changes have not yet been widely shared, then you can use something like git-filter-branch to process the "master" repository (whichever one that is) to remove the large files. Then, replace the old master repository with your newly crafted one and continue from that point. You may need be careful pulling changes from this new master repository into existing repositories, or just discard them and make a new clone.

Greg Hewgill