Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove parts of our bloated git history [duplicate]

Tags:

git

My Problem:

Early on when the repository was set up a mistake was made causing all the images at the time to be written to the repository. This was quickly rectified in the gitignore file and no longer presents a problem.

The problem is now that we have an enormous repository which contains the history of the images. This presents a problem when cloning the repository locally as it takes a lot longer than a clean clone from the tip.

My questions:

Is there a way of removing the part of the history that includes the images which are never going to be needed?

If I cannot remove can I compress or even cleanup the history in any way?

like image 727
Andy Avatar asked Dec 10 '25 10:12

Andy


1 Answers

If it is removing part of history - you use git rebase interactive

if it is file removal (from all versions) use git filter-branch

like image 181
forvaidya Avatar answered Dec 12 '25 03:12

forvaidya