I'm going to use an external USB drive as the second drive, because that's usually where I perform backups, however, git-annex supports anything that could be a git repository, meaning github, or another computer, it even supports a lot of special remotes like backing up the S3.

I am using a USB drive mounted at /Volumes/MINIDRIVE1/ , so adjust as needed to a different location on disk, wherever you device is mounted. You can also use another folder if you don't have a USB drive handy.

First, let's make a folder on the USB drive and initialize it as both a regular git repo and a git-annex repository, but this time, named "usbdrive"

hinmanm@Xanadu 0 ~/myrepo(master)% mkdir /Volumes/MINIDRIVE1/myrepo hinmanm@Xanadu 0 ~/myrepo(master)% cd /Volumes/MINIDRIVE1/myrepo hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo()% git init Initialized empty Git repository in /Volumes/MINIDRIVE1/myrepo/.git/ hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% git annex init "usbdrive" init usbdrive Detected a filesystem without fifo support. Disabling ssh connection caching. ok (Recording state in git...) hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)%

Next we need to let each of the two locations ~/myrepo and /Volumes/MINIDRIVE1/myrepo know about each other. This is accomplished by adding each location as a remote, using the git remote command.

First we'll let the original repo know about the USB drive

hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% cd ~/myrepo hinmanm@Xanadu 0 ~/myrepo(master)% git remote add usbdrive /Volumes/MINIDRIVE1/myrepo hinmanm@Xanadu 0 ~/myrepo(master)%

And then let the usb drive know about the laptop

hinmanm@Xanadu 0 ~/myrepo(master)% cd /Volumes/MINIDRIVE1/myrepo/ hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% git remote add laptop ~/myrepo hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% cd ~/myrepo hinmanm@Xanadu 0 ~/myrepo(master)%

Now that each repository knows about the other one, you can use the git annex sync command to synchronize the git state between each, so if we run it in each folder we can see that the folder on the USB drive has been updated with the name of the file in the repository

hinmanm@Xanadu 0 ~/myrepo(master)% git annex sync commit ok pull usbdrive warning: no common commits remote: Counting objects: 5, done. remote: Compressing objects: 100% ( 3/3 ), done. remote: Total 5 (delta 0 ), reused 0 (delta 0 ) Unpacking objects: 100% ( 5/5 ), done. From /Volumes/MINIDRIVE1/myrepo * [new branch] git-annex -> usbdrive/git-annex ok (merging usbdrive/git-annex into git-annex...) (Recording state in git...) push usbdrive Counting objects: 17, done. Delta compression using up to 4 threads. Compressing objects: 100% ( 13/13 ), done. Writing objects: 100% ( 17/17 ), 1.60 KiB | 0 bytes/s, done. Total 17 (delta 1 ), reused 0 (delta 0 ) To /Volumes/MINIDRIVE1/myrepo * [new branch] git-annex -> synced/git-annex * [new branch] master -> synced/master ok hinmanm@Xanadu 0 ~/myrepo(master)% cd /Volumes/MINIDRIVE1/myrepo hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% git annex sync (merging synced/git-annex into git-annex...) commit ok pull laptop From /Users/hinmanm/myrepo * [new branch] git-annex -> laptop/git-annex * [new branch] master -> laptop/master * [new branch] synced/master -> laptop/synced/master Already up-to-date. ok hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)% ls -lh total 64 lrwxrwxrwx 1 hinmanm staff 198B Dec 20 13:09 Grace-Hopper-Nanoseconds.mp4@ -> .git/annex/objects/5X/Gv/SHA256E-s5769029--dc383e922caca7a52eb8c44e0d79fdce22e597e667ba29732966e462ac483cf7.mp4/SHA256E-s5769029--dc383e922caca7a52eb8c44e0d79fdce22e597e667ba29732966e462ac483cf7.mp4 hinmanm@Xanadu 0 /Volumes/MINIDRIVE1/myrepo(master)%

However, you can see that the content hasn't actually been copied over, only the metadata (the symlink), you can verify this with the file command