Hi,
Is there a preferred way to add files to git's index (instead of the annex) while in direct mode?
I am trying to use git-annex for scientific data. On linux and mac in indirect mode, the git workflow is basically unchanged, and I really like the way git annex works. Unfortunately when I use git-annex on Windows, I have not found a good way to add things to git's tree.
I've tried two things:
$ git annex proxy -- git add smallfile
This is slow because it has to copy things over to create a work tree
$ git config annex.largefiles="*.pdf or *.h5"
$ git annex add largefile.pdf
This doesn't seem to work as well as I'd like either. I'd like the equivalent of a git add
command in direct mode.
In what way does setting annex.largefiles and using git annex add not work as well as you'd like?
Sorry, I should have clarified. I was not sure how to add a commit message.
I played with a test repo and I think I figured it out. What I tried was this:
So if I understand correctly, in direct mode
git add
->git annex add
git commit -m MSG
->git annex sync -m MSG
git log
now shows the right message, but I am still not sure how to check whether a file is in the annex or directly in the git tree. I suppose I could just make aliases for git add and git commit, but I wouldn't be able to add arbitrary files to git annex without playing with annex.largefiles. For example, if I had many small.txt
files and one large file and I wanted to just add that large file to the git annex, I'd have to change the largefiles setting.Is there a better way of doing this or is loss of functionality intrinsic until Windows symlinks work?
You can temporarily set annex.largefiles to match no files, while running git-annex add, to force it to add the file to git instead of the annex.
git -c annex.largefiles='exclude=*' annex add somefile