0

Is it possible to remove historical file references for files not in head? I have a repository that has 109,000 commits and working through that many commits with a Rewrite is terrible.

Renaming directiories done following logic from here
https://gist.github.com/emiller/6769886

I'm trying to clean up a git repository in which I have done historical directory moves, maintaining history, now that I have confirmed that the history stayed with the new directory I would like to remove the old directory and all of it's history.

I plan to use the following when completed to split the directories dynamically. https://help.github.com/articles/splitting-a-subfolder-out-into-a-new-repository/

I have tried the following, but it doesn't seem to clean up old commits that don't do much for me.

git gc

Expected result of re-hash is a small repository that doesn't contain the history for the directories that have been subsequently removed.

that_roy
  • 59
  • 9

1 Answers1

1

I think you're looking for git filter-branch: https://gitirc.eu/git-filter-branch.html

This question is related: How do you fix a bad merge, and replay your good commits onto a fixed merge?

joanis
  • 10,635
  • 14
  • 30
  • 40
  • Yes, turned out to be git filter-branch, the cleanup to do this isn't any fun! Thanks @joanis for the assist. – that_roy Mar 31 '22 at 18:36