I'm currently trying to migrate a git-annex repository to a new machine, one of whose remotes is the one from this issue. I determined that the root cause there seemed to be under git rather than git-annex; in particular, any whole-repository operation would take multiple days to execute, for unclear reasons. Pulling the commit data to a new repository seems to fix this.
I'm now trying to move all the annexed data from the original, broken remote to the new one. The default option here would be git annex move
. However, when I run this, it apparently does some git operation for every key moved, taking hours to days; there are tens of thousands of keys, so this is obviously unworkable.
Is there a way to simply mass-move the annexed data into the new repo, via rsync or similar, and then update the new repo's metadata all at once? The state of the old repository does not matter, since I intend to discard it as soon as this migration is done.
Hi, this worked for me:
echo test > file
I would just clone the repo to the new machine, do
git annex init
, and then rsync the contents of.git/annex/objects
, and then dogit annex fsck --all
to have to recheck every key it knows about.Alternatively, if you're concerned that there might be keys that weren't properly recorded somehow, in your new repo, after
.git/annex/objects
has been transferred, you can create an ingestion directory with a flat layout of the copied keys:Finally, if you just want to rebuild it from scratch, do cp with the
-cL
option. If you are on macOS, it will make a reflink copy, and follow the symlinks. Delete the target .git dir and re-create it.