forum/Add annex files outside git root directorygit-annexhttp://git-annex.branchable.com/forum/Add_annex_files_outside_git_root_directory/git-annexikiwiki2015-02-12T16:22:18Zcomment 1http://git-annex.branchable.com/forum/Add_annex_files_outside_git_root_directory/comment_1_3d7c8917633a6632f22385b8f7a98ccf/joey2015-02-04T19:01:25Z2015-02-04T17:19:46Z
<p>git-annex should have no difficulty doing that, and in fact its test
suite includes some adds of files in subdirs.</p>
<p>The most likely reason for this behavior would be if you have configured
a <code>.gitignore</code> 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.</p>
<p>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.</p>
comment 2http://git-annex.branchable.com/forum/Add_annex_files_outside_git_root_directory/comment_2_312a57883d809857a69216fa47e04f17/Michael2015-02-12T16:22:18Z2015-02-12T16:22:18Z
<p>Ok, seems that I assumed incorrectly that <code>.gitignore</code> files were not valid for annex.</p>
<p>However, if I <code>git add file_that_is_ignored</code>, I get an error message saying:</p>
<pre><code>The following paths are ignored by one of your .gitignore files:
Use -f if you really want to add them.
</code></pre>
<p>Would it be possible for git-annex to be consistent with git behaviour here?</p>