Moving two existing already-synced directory trees to git annex

I have two copies of my music files, one on a desktop Linux machine, one on a Macbook. At the moment, I run rsync periodically to keep these files in sync. I'd like to move management of this problem to git annex, but was wondering what the cleanest way to start would be.

In particular, if I independently do

git init
git annex init "My music on <Laptop|Desktop>"

on both machines, what should I then do to get annex to take over synchronisation without needing a big synchronisation step subsequently?


I have done exactly that a while ago and documented this on the official tips section of the git-annex website.

Basically, the answer is that, since git-annex performs decentralised deduplication, there won't be a big sync. So on each machine, you can do:

git init
git annex init "My music on <Laptop|Desktop>"
git annex add .
git commit -m "git annex yay"

Then on one of the machines (the laptop, i would suggest), add the other (the desktop) as a remote:

git remote add desktop desktop.me.example.com:/srv/music
git annex sync desktop

The last sync operation only syncs metadata, mind you, that is the location tracking data, basically. To copy files around, you will actually want git annex copy or .. move. Using those techniques, I have been able to keep a smaller subset of my music collection on my laptop fairly reliably, and even manage it (e.g. rename files, import new files) while being offline while never worry about losing files.