so i mistakenly merged two unrelated repos together. i have "canceled" the merge as in reverted it by removing the created files, but then those zillion of small files will stick around the git repository forever.
is there a way to use something like git annex forget
for this? i know about things like git rebase --onto but that won't propagate across all repositories... can git-annex give me a hand here? --anarcat
so while
git rebase
can do magic, it will not work out of the box on direct mode repositories, unless you use-c core.bare=false
, in which case you will totally shoot yourself in the foot because git will happily remove all those real files sitting in the checkout. you will need togit annex indirect
before you do any of that magic. working on a clone of the git repo is also a good idea, if only for testing.i personnally destroyed my whole music collection doing such a cleanup of the history. fortunately, i had a recent archived clone of the repo, so things weren't so bad.
but watch out for direct mode, as always.
So it seems i am able to forget all of this within the matter of a few days, and since this is so error prone, here goes a more detailed explanation.
What I do is:
Then for each repo:
It would be useful to have that transition propagate properly everywhere so I don't have to do this in every repo, but at least the above should work fairly reliably.