I am trying to set up two repositories, one on my laptop and one on my server, and then have "git annex sync" always push everything on the laptop to the server.
So far, I have created repositories on the laptop and on the server and then added the server as an ssh remote on the laptop. At the root of the repository on the server, I ran "git annex group . backup" and "git annex wanted . standard". At the root of the repository on the laptop, I ran "git annex group . manual" and "git annex wanted . standard". When I run "git annex sync" or "git annex sync --content" on the laptop now, it seems to only copy the symlink information to the server but not the actual data. When I go to the server and run git annex sync, it updates the working tree symlinks but does not have the content data they point to. If I use "git annex copy file --to server" then the symlink created when I ran "git annex sync" on the server points to the correct file. Do I not have the correct content preferences set up? Or do I need to alias "git annex sync --content" to "git annex sync --content && git annex copy . --to server" on the laptop?
I want to be able to drop large amounts of data from the laptop and get it back if needed but always have it available on the server any way without having to push it explicitly. I would think that this would be a fairly common use case. Maybe I have missed something in the documentation? I have not set up the laptop as a remote on the server (I'd prefer not to -- I only plan to push/pull from the laptop, not push/pull from the server).
The configuration you describe sounds right and should work.
Are you sure that the laptop had seen the changed configuration from the server when
git annex sync --content
didn't send files to the server? Ie, did you try running it a second time?Okay, sorry, in the previous posts, I misunderstood parts of how git annex works. Let me break down what I want to do again and how I have tried to set it up.
Use case
The basic use case is to have a client (could be more than one) generating content that is pushed to a server. The client would like to be able to drop any data at any time, while the server is expected to keep all data at all times. Additionally, the data stored in the server should be visible in the working tree to other users on the server (and the working tree should stay up to date). The client has push access to the server, but the server does not have pull access to the client.
Set up
I have taken the following steps to try to set this up so far:
git merge synced/master master
to theannex-content
hook described here and to thepost-receive
hook (I did this because theannex-content
hook was not being called for updates pushed by the assistant -- should it be?).git config core.sharedrepository group
on the server repo as described here so that the server's files are accessible to other users in the same group.chgrp -R shared "$(git rev-parse --show-toplevel)"
to theannex-content
,post-receive
, andpost-merge
hooks.Questions
The above set up seems to be working now. My remaining questions are:
git-annex
andgit-annex-shell
onto my path and notgit
,git-upload-pack
,git-receive-pack
, etc? Maybe there is no downside to using the versions that are packaged with git annex for all of my general git usage, but I'd rather just use the system git for things other than git annex.