I need to shrink my long living GIT repository by removing old commits history.
Transform sth like this:
A - B - D - E - ...
\ /
C
Into:
D' - E - ...
the commits history after commit E is quite complex, contains a lot of branches, tags, merges etc.
I don't care about other users because this is a migrated repo that has not yet been pushed to any remote repository. It is a bare repository on my local machine. I can transform it to a "normal" one if needed.
To create D' and print its hash I could use:
git commit-tree D^{tree}
But the question is how switch the parent of commit E from commit D to commit D'?
At this stage, most of the tips I've already found suggest doing a rebase master branch onto D', but it's not so easy when you have a complex history with commits for over a decade with a lot of multiple branches, tags, merges etc.
Is there any low-level GIT command to simply switch the pointer to the parent commit without doing a git rebase when I'm 100% sure that the new parent commit contains all content of the current one?