I have one server, two computers, and one external HDD.
The git-annex repo on my server (nhost
) has the following remotes:
qhost qhost:NIdata (fetch)
qhost qhost:NIdata (push)
zhost zhost:NIdata (fetch)
zhost zhost:NIdata (push)
The repo on zhost
has the following remotes:
data0 /run/media/mee/data0/NIdata/ (fetch)
data0 /run/media/mee/data0/NIdata/ (push)
nhost nhost:NIdata (fetch)
nhost nhost:NIdata (push)
The repo on my HDD (data0
) has thefollowing remotes:
nhost nhost:NIdata (fetch)
nhost nhost:NIdata (push)
qhost /qhost/home/mee/NIdata/ (fetch)
qhost /qhost/home/mee/NIdata/ (push)
zhost /zhost/home/mee/NIdata/ (fetch)
zhost /zhost/home/mee/NIdata/ (push)
Any ideas how I can set up a remote from nhost
to data0
, without making the identity of data0 dependent on which machine I am using on each particular session?
I'm not entirely sure I understand the question, but think you're probably trying to make nhost be able to access data0 independant of whether the external HDD is plugged into nhost or zhost (or perhaps qhost, whatever that is?)
The way to do that is simply to set up one remote for each place the HDD can be plugged into. If the HDD can be plugged in locally, make a remote pointing at the local mount point. If the HDD can be plugged into zhost, make a remote pointing at zhost:/run/media/mee/data0/NIdata/ and so on.
git-annex will figure out that these different remotes are pointing at the same repository. When running
git annex get
orgit annex sync --content
, it will check if the HDD is mounted locally, and will use it there if so; if not it will fall back to trying to access it via the remotes that use zhost etc.So in summary, git-annex is designed to just work in this kind of scenario. Set up lots of remotes and let it figure out which ones to use.