Say I have two unrelated videos repositories. Say that, by some mistake of history, one was added as the git remote of the other. I somehow managed to clean the git history and disentangle the files between the two repos.
Now git-annex still thinks about that other repository. I can mark it as dead, but it will still have location tracking information for all the files of the other repository.
I know about git-annex-forget: I'm not sure it's what I want. I do not want to "[throw] away historical data about past locations of files", I would actually want to keep historical location data for relevant files. I want to forget a repository ever existed.
Is that possible?
Marking it with git-annex-dead doesn't cut it, from what I understand. In what to do when you lose a repository, joeyh seemed to say "dead
is the best we can do", as "the automatic merging used on the git-annex branch tends to re-add lines that are deleted in one repo when merging with another that still has them." But now we have something like forget
, could that be coerced into forgetting just a subset of stuff?
Thanks! -- anarcat
This has happened repeatedly to me and I feel your pain. It is especially likely to happen when using submodules, which can sometimes be uninitialized, so when you enter them and modify
git remote
s from there, you're actually messing up the parent repo.I'm afraid there's no convenient way to purge git annex remotes except marking as
dead
and thenforget --drop-dead
, which loses past location history as well.What you can do though is trying to manually kick the bad commit out of the git-annex branch (e.g.
git rebase -i
), then force-push the git-annex branch to all remotes. If you miss one remote, the bad commit will be reintroduced somewhen later.git-annex forget --drop-dead
is probably the best answer.Yes, this also deletes historical data about past locations of files. The only user-visible effect of that is that
git-annex log
won't show where files used to be located.It has to delete history, because history includes all the data that was merged from the other repository. And it would be too hard to traverse all history and delete any information that came from that repository in every commit.