Hosting a Git Annex on a server without git-annex installed
Machines A and B host a common git annex repository. They both have the git-annex program installed and I manually edit/commit/etc stuff on both machines. A & B are not connected to the internet at the same time, so they can't be synced together directly.
Server C is always on and connected (and free and pretty secure). It has git installed, but I don't have admin rights, so I can't install git-annex.
My question: Can I use Server C as a central hub to push and pull git-annex updates from both A and B, without having to install git-annex and the whole haskell ghc dependencies on C?
I tried using C with "directory" or "rsync" special remotes, but this seems to only hold files, not the rest of what's needed to update A and B after push/pulls.
Any hint would be much appreciated!
With git and rsync access to the same server you can use that server to store both the history (via git access) and the annex key-value store (via rsync access). These could also be decoupled and stored on any number of different servers.
It looks like you've already read up on all of the tools you'll need. Basically, you'll end up with 2 separate remotes, both pointing to different locations on server-c. The first remote (server-c) is a regular git remote for synchronizing your history and anything that is checked directly into the git repo. The second remote is an annex special remote.
[remote "server-c"]
url = [email protected]:/path/to/repo.git
fetch = +refs/heads/*:refs/remotes/server-c/*
[remote "server-c-rsync"]
annex-rsyncurl = example.com:/home/user/annex-rsync
annex-uuid = ...
You should be able to set this up with something along the lines of:
git remote add server-c [email protected]:/path/to/repo.git
git annex initremote server-c-rsync type=rsync rsyncurl=example.com:/home/user/annex-rsync encryption=none
This should get you the basic functionality that you're looking for. The only downside is that you have 2 different remote names that really point to the same server. In particular you just have to remember to use the special remote (server-c-rsync) when using the --to= or --from= arguments of get, copy, and move.
It may be possible to point a single remote to both locations, however I'm not sure if this is actually supported. The following commands appear to create a sensible .git/config.
git init
git annex init "test"
git remote add server-c [email protected]:/path/to/repo.git
git annex initremote server-c type=rsync rsyncurl=example.com:/rsync/user encryption=none
For me this results in a single remote in .git/config with both a url= (for the normal git operations) and a annex-rsyncurl=. However, I have not tested this any further to ensure that git annex ignores the url and uses only the annex-rsyncurl entry when operating with annexed files.