Backing up in the cloud using git-annex and (2024-03-17)

An influential technical article (from over 7 years ago) was Joey Hess here writing about keeping his home directory in SVN: Subverting your homedir, or keeping your life in svn

Joey has since then built (in Haskell)

The goal this morning’s exercise is to backup a fairly large repository (of old comic books) to using git-annex on both Linux and Windows.

It turns out, for git-annex newbies such as ourselves, this is not straightforward. There is a learning curve, which is steep even for experienced git users, such as ourselves.

  1. Create a New Repository
cd /path/to/your/repository
git init
git annex init "Comic books"
  1. Let’s add a file ( in our case)
echo "This directory contains a bunch of comic books an dis managed by git-annex." >
git add
  1. Commit the File
git commit -m "Adding"
  1. Add a Remote Host
    Here is Joey Hess providing some interesting details (such as - could use rsync:// or ssh://)

As it turns out… fatal: git-over-rsync is no longer supported

git remote add rsyncnet_annex ssh://
git annex initremote rsyncnet_annex type=rsync encryption=none
git annex sync rsyncnet_annex

Possible remote types (ssh is not one of them): git gcrypt p2p S3 bup directory rsync web bittorrent webdav adb tahoe glacier ddar git-lfs httpalso borg hook external

  1. Back Up the Repository
git annex copy --to=rsyncnet_annex

This will copy the content managed by git-annex to your remote host named rsyncnet_annex. Remember, git-annex is used to manage files with git, without checking the file contents into git — so if you’re only working with a README file and you want it backed up as well, make sure it’s handled appropriately by git-annex or consider using standard git push commands to synchronize your commits:

git push rsyncnet_annex main

TLDR: git-annex is useful for handling large files or binary data that you don’t want to store directly in the git repo. For typical source code files and small markdown documents, regular git operations are usually sufficient.