It seems I can't initialize git annex:
$ git annex init "files2"
init files2
pre-commit hook (/Volumes/project/annex/.git/hooks/pre-commit) already exists, not configuring
git-annex: waitToSetLock: failed (Operation not supported)
failed
git-annex: init: 1 failed
$
project
is a remote file server connected via smb://
.
Any ideas why and how to fix?
The smb:// is a red flag to me. git-annex relies on POSIX file locking, and I'll bet smb does not provide that, or, perhaps, your samba server needs a configuration change to support it.
You might consider putting your git annex repository on the local filesystem, and setting up a special remote on smb. The directory special remote is a likely choice.
Thanks for getting back so quick; So, after doing
What else do i need to do? Do i need to
git init
and/orgit annex init
in/Volumes/subproject/
?Nope, you're set with just those two commands. You can now do things like "git annex copy --to smb" to put files there, and "git annex get" will get files from there as necessary.
git annex sync
to do two-way sync between local andsmb
?git annex sync
only syncs the git repository, not file contents, and the special remote has no git repo, only file contents.git annex copy
will avoid transferring things that are already there, so it's the way to go.If you want automatic syncing of file contents and lots of other magic including automatic commit of new files, you could try the ?code> command replace all files with pointer file..
OK; The reason i ask about
git annex sync
is because I had previously copied the large files ontosmb://
before setting up theannex
and don't want to unnecessarily transfer large data over Internet again. But now if i dogit annex copy --to smb
, and check what's added/changed insmb
end, i foundThe files with numbers in names such as
091
,383
are being added, thebigfile1
andbigdir1
are the ones previously copied there. What are those091
,383
etc.That's where it stores files in the directory special remote. You can move the similar contents of /Volumes/subproject/.git/annex/objects/ to the same place as those and then run
git annex fsck --from smb --fast
and it'll learn about those files you already transferred.You probably also want to delete /Volumes/subproject/.git afterwards, and any git working tree that was checked out there before; the directory special remote does not use the git repository that you had there before.
/Volumes/subproject
connected viasmb://
is the actualbigdir1
andbigfile
, not the encoded objects. Maybe I should use some other types of special remote?/Volumes/subproject
is a remote partition connected via smb://. It doesn't have a.git
. The content I mentioned previously "copied" there was copied viacp -R
. And my local annex is~/project/subproject
and it does have.git
and.git/annex
in it.If you need a git repository with your regular file names on the smb share, none of the special remotes will meet your needs. You'd need to find a way to make it support POSIX locking to use git-annex on it in a full git repository.
But I think that in most cases a directory special remote on such a share, with the git repository kept locally and git-annex used to pull files down to it as needed, would work ok.
smb://
partition is to publish these big data files, so other (potentially non-technical) people can download and use them. They'll not be willing to learn how to use git, let alone git-annex. And i have multiple development machines that can generate revisions/updates to these big files. I previously just rsync from/to various development machines to/from this smb partition, but i find sometimes I don't always srync in correct direction. The hope is i can have annex on these development machines, and set the smb:// partition as the remote for these git annex. But it sounds like none of the special remote will have the original form, and a normal remote is not possible on smb:// partition.