Is there a safe way to remove an old commit that is taking up a lot of space in Git?

116 Views Asked by At

I want to preface this question by saying that I'm aware of the fact that rewriting history in Git is usually a bad practice, but I'm facing a problem to which I cannot seem to find another type of solution.

We have noticed that our repo (which is a porting of a very old SVN project) has a stunning size of 2.4 GB as reported by GitLab, even though it's below 80 MB when checked out. This is creating some performance problems in our pipeline.

It seems like the cause of this anomalous size is a old pre-porting commit in which -I suppose accidentally- 3.7 GB worth of zip files where saved to the repo, and deleted immediately after.

A - ... - B (very large commit) - C (revert) - ... - D (Basically every other branch starts from here)

Since this commit is 5 years old and every active branch stems from there, I need to find a very clean solution to avoid any kind of problems to all the people currently working on the project.

Is there a reasonably safe way to do this or is it better to leave as it is?

0

There are 0 best solutions below