I have a big git-annex repository. If I add a few files on my laptop I want to sync it with my server which consists of one bare git-annex repository (server_bare) and one regular git-annex repository (server).
I run
git annex sync git annex copy * --to server
The second command is really slow since it runs git annex copy on every single file that I have locally (it sometimes takes an hour to complete). If I would instead run
git annex sync git annex get .
This is usually quite fast, but it is not so easy to do since I don't keep an SSH port open on my laptop.
My question: Is there any command that I can run on my laptop which basically invokes "git annex get ." from the server?
Try
git annex copy --fast --to server
That avoids checking if the server still has every file, and only sends files it knows the server does not have. If you've just synced with the server, it knows what's on the server, so this can't go wrong.
That'll be almost as fast as
git annex get
I'm running v6.20170519 on Fedora. Syncing between my desktop and my external drive (USB3).
When I do the following:
The output shows every single file in the respository followed quickly by an OK. Output-wise it's no different than if i omitted the --fast flag.
However, when I do the following,
The only output is the files being copied over. It also appears to be faster for me than a copy.
I feel like i'm missing something basic or some step? Is copy --fast doing the same amount of work as get but just displaying more output?
I tried git annex copy --to desktop from my laptop:
without --fast, I see a "(checking desktop)" line with --fast, I only see the lines corresponding to transfer between files.
Given that I don't see a "checking" line when I do this with my usb, I assume that it's not actually checking. However, I'm puzzled by the difference in output between the USB and the SSH scenarios.
I still feel like I have a basic misunderstanding here, and I apologize in advance.
The behavior is different when the remote repository is on the USB drive, because git-annex knows it can quickly check if the remote really contains a file, and so it always checks it, even with --fast.
I'm not sure if you're actually seeing a significant speed difference, or are psycholicically feeling it's slower since it outputs more. Perhaps you should time it.