Hi,
I love the idea of git-annex, and I'm trying to do my first steps with it. I'm stuck on the following issue:
When creating a git repository and annexing a file in the root directory, everything works as expected:
git init
git annex init "mytest"
echo 1 > annexfile
git annex add annexfile
# add annexfile ok
# (Recording state in git...)
However, when I try to add a file in a subdirectory of the repository, the adding command fails without any error message:
mkdir mydir
echo 1 > mydir/myfile
git annex add mydir/myfile
# no message, no status change, nothing
# note that I can add the file in the root dir and then move it to `mydir`
Am I doing something wrong here?
Thank you!
git-annex should have no difficulty doing that, and in fact its test suite includes some adds of files in subdirs.
The most likely reason for this behavior would be if you have configured a
.gitignore
file (or other method of configuring gitignore) to exclude the file you want to add. If so, "git annex add --force mydir/myfile" would override the gitignore.Internally, git-annex add runs "git ls-files --others --exclude-standard" and passes it the files/dirs you specified to add, and then adds the files that command lists. So you can run that command and see what it lists too.
Ok, seems that I assumed incorrectly that
.gitignore
files were not valid for annex.However, if I
git add file_that_is_ignored
, I get an error message saying:Would it be possible for git-annex to be consistent with git behaviour here?