Hi, I am trying to use annex, but couldn't find a way. It will be very helpful if anyone can help.
I have NAS mounted on specific directory /mnt/nas/ Suppose whole directory in it is READ-ONLY and keep the file, structure as it is now.
I want to "annex add" files in that directory like git annex addurl file:///mnt/nas/a.mp4
But it seems addurl is only for http/https and "directory special remote" have to change the whole structure of the directory. Is there any alternative I can try?
Thanks.
Okay I got git annex addurl file:/// working with this config.
But it copies the file to local directory, is there a way to make it just calculate checksum without copying(downloading) it?
Or if there's just alternative way please let me know.
git annex import
and its various options, it sounds like that's what you're after.thanks, but It seems git annex import is just same as
Is there a way to avoid copying file when trying to add file in annex repository, but do all the required operations like checksum calculation (as it is already accessible in local filesystem through nas)
This is a job for a directory special remote with importtree=yes
As shown this will merge all files in /mnt/nas into your master branch, without downloading the content. You can
git-annex get
files from there later. It's also possible to import the files into a subdirectory, see git-annex-import.If you want to only add a single file, you can replace the
git merge
with something else, or configure the preferred content expression of the remote to only match that file.Thanks joey. This is almost close to what I wanted. But I wanted to naviagate and open the file without "annex get" the content. When I add file in this way, dead symbolic link is created and it would end like
It would be great if it can be something like this
It might not be proper feature, just asking if it's possible or alternative way for doing this.
Or
Is there way to get the original directory of the file? Something like this
$ git annex {somecommand} a.mp4 # Output: /mnt/nas/a.mp4
I couldn't find a way to do this with
whereis
. If it's possible I could just write custom xdg-open command.