I am importing lots of files from various sources, and want to make sure that I don't inadvertently commit big files to git. On a file-by-file basis, it's easy enough to tell if it matches the inclusion pattern. But for lots of files, I find myself doing:
git annex add .
- Look for the "non-large file; adding content to git repository" message
git reset
git annex config --set annex.largefiles ...
to add the new file extension to the list
git add
doesn't provide any info on what goes where.
So is there a way to see, in a given directory, what would be annexed and what would be stored in git when doing git add
/ git annex add
?
git config annex.addsmallfiles false
will make it sogit annex add
only adds files that should be annexed. So I cangit annex add
first, and then if I have any files left over that should have been annexed, I can add their file suffixes to the inclusion list. Slick!Good solution. And if it somehow added a file to annex that you want in git you can
git annex unannex
easily enough.There is not any way to query without adding, query commands like
git-annex find
only operate on annexed files so it would need to be a new mode added to the command. Or I supposegit annex add --dry-run
could be made to, but don't know that I really like the idea. I like your solution better than these ideas though.git annex add --dry-run
is actually the first thing I triedI came across
git-annex-matchexpression
and was able to put together this script that neatly shows me what untracked files will go where:git-annex
? I almost always want to work with untracked files at first, which means usinggit add
to add them (becausegit-annex
doesn't have an--unlocked
option afaik). Adding them to git by mistake is not good. And really it's just helpful to know when I have new files, are they going to git or to annex.You can use
git annex add --force-small/--force-large
to explicitly specify.annex.addunlocked can make git-annex add add annexed files unlocked, although of course git-annex unlock after adding has the same result.