I've gone through most of the screen casts and lots of documentation, but my first attempt produced an unexpected result.
I wanted to use git-annex is a Dropbox-simplistic setting - syncing a directory between my notebook (OSX) and my desktop (OpenSUSE 12.3). Running the assistant on OSX and adding a "Remote server" repository, changing the repository group to client produced a bare repository on the desktop.
Am I missing something obvious?
I've tried a few different version of git-annex, most recently
git-annex version: 4.20130727-g9399845 build flags: Assistant Webapp Pairing Testsuite S3 WebDAV Inotify DBus XMPP
but it remains the same.
I found a partial answer on http://git-annex.branchable.com/forum/Add_a34local34remote : "The webapp does not set up remote non-bare repositories because unless the user is comfortable with the cli, nothing is going to keep them up-to-date."
So, clearly "Remote server" isn't what I want, but my "desktop" is headless and using jabber seems a silly complication when I have a perfectly fine ssh connection. This isn't as trivial as I had expected.
Make a non-bare git repository on your server. Run
git annex init
in it. Rungit annex assistant
in it.Now on your notebook, you can tell the assistant to use a remote ssh server, and point it at that directory. It will see the repository already exists, and use it, rather than making a new bare repository. The assistant daemon you've run on the server will notice when changes are pushed to the directory, and update it.
You can further set up XMPP, so that the server can tell the notebook if you make any modifications to the server. You can do this by running
git annex webapp --listen=IPADDRESS
on the server, and opening the url it prints out. But this is optional, only needed if you're going to be editing files on the server.I setup a non-bare repo on a server by following the above steps (git init, git annex init, then add it as a Remote Server from elsewhere and combine repos). It worked, but I hit a snag and needed to add another step.
After git init, you're not sitting on any branch yet, and that seems to have prevented the assistant from doing anything to synchronize the working tree on the server. After I did "git checkout synced/master", it started working.
There's at least one caveat with the 'git checkout synced/master' workaround. When the local assistant next tries to sync with the remote, it will try to push, and the remote will refuse the push into the currently checked out branch:
[2014-12-26 02:40:10 EST] main: Syncing with nyc.nanobit.org_annex remote: error: refusing to update checked out branch: refs/heads/synced/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To ssh://catalinp@git-annex-nyc.nanobit.org-catalinp_22_annex/~/annex/ ! [remote rejected] annex/direct/master -> synced/master (branch is currently checked out)