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 https://git-annex.branchable.com/ (in Haskell)
The goal this morning’s exercise is to backup a fairly large repository (of old comic books) to https://rsync.net/ 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.
- Create a New Repository
cd /path/to/your/repository
git init
git annex init "Comic books"
- Let’s add a file (
README.md
in our case)
echo "This directory contains a bunch of comic books an dis managed by git-annex." > README.md
git add README.md
- Commit the File
git commit -m "Adding README.md"
- Add a Remote Host
Here is Joey Hess providing some interesting details (such as - could usersync://
orssh://
)
As it turns out…
fatal: git-over-rsync is no longer supported
git remote add rsyncnet_annex ssh://xyz@xyz.rsync.net:annex
git annex initremote rsyncnet_annex type=rsync encryption=none rsyncurl=xyz@xyz.rsync.net:annex
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
- 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.
Links
- Here is how the folks from the Canadian Open Neuroscience Platform are using git-annex: GitHub - CONP-PCNO/git-annex-remote-conp: 🔗 Git annex remote for CONP
- How to undo `git annex initremote` - Stack Overflow
- How to delete a remote?
- Truly purging dead repositories
- gcrypt