# Backing up in the cloud using git-annex and rsync.net (2024-03-17)

**URL:** <https://pluralist.net/t/backing-up-in-the-cloud-using-git-annex-and-rsync-net-2024-03-17/110>\
**Category:** breadcrumbs\
**Created:** [March 17, 2024, 7:59pm UTC](https://pluralist.net/t/backing-up-in-the-cloud-using-git-annex-and-rsync-net-2024-03-17/110 "2024-03-17T19:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![delyan](https://pluralist.net/user_avatar/pluralist.net/delyan/32/245_2.png) [@delyan](https://pluralist.net/u/delyan)\
**Post date:** [March 17, 2024, 7:59pm UTC](https://pluralist.net/t/backing-up-in-the-cloud-using-git-annex-and-rsync-net-2024-03-17/110/1 "2024-03-17T19:59:15Z")

</div>

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](https://joeyh.name/svnhome/)

Joey has since then built [https://git-annex.branchable.com/](https://git-annex.branchable.com/) (in [Haskell](https://www.haskell.org/))

* * *

The goal this morning’s exercise is to backup a fairly large repository (of old comic books) to [https://rsync.net/](https://rsync.net/) using [git-annex](https://git-annex.branchable.com/) 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**

```bash
cd /path/to/your/repository
git init
git annex init "Comic books"

```

1. **Let’s add a file** (`README.md` in our case)

```bash
echo "This directory contains a bunch of comic books an dis managed by git-annex." > README.md
git add README.md

```

1. **Commit the File**

```bash
git commit -m "Adding README.md"

```

1. **Add a Remote Host**  
Here is [Joey Hess providing some interesting details](https://git-annex.branchable.com/design/assistant/blog/day_70__adding_ssh_remotes/) (such as - could use `rsync://` or `ssh://`)

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

```bash
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

1. **Back Up the Repository**

```bash
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:

```bash
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](https://github.com/CONP-PCNO/git-annex-remote-conp?tab=readme-ov-file#git-annex-remote-conp)
- [How to undo `git annex initremote` - Stack Overflow](https://stackoverflow.com/questions/31720266/how-to-undo-git-annex-initremote)
- [How to delete a remote?](https://git-annex.branchable.com/forum/How_to_delete_a_remote __63__ /)
- [Truly purging dead repositories](https://git-annex.branchable.com/forum/Truly_purging_dead_repositories/#comment-51ab797094f4c07bf5327fd21cad5835)
- [gcrypt](https://git-annex.branchable.com/special_remotes/gcrypt/#comment-1bd9e04e2299b9778fd8445a0471a9e1)
