Re: "git add $ignored_file" fail

From: Linus Torvalds <torvalds@osdl.org>
Date: 2006-05-17 08:28:09
On Wed, 17 May 2006, Santi wrote:
> 
>      When you try to add ignored files with the git-add command it
> fails because the call to:
> 
> git-ls-files -z \
>        --exclude-from="$GIT_DIR/info/exclude" \
>        --others --exclude-per-directory=.gitignore
> 
>      does not output this file because it is ignored. I know I can do it with:
> 
> git-update-index --add $ignored_file
> 
> I understand the behaviour of git-ls-files but I think it is no the
> expected for git-add, at least for me.

Well, the thing is, git-add doesn't really take a "file name", it takes a 
filename _pattern_.

Clearly we can't add everything that matches the pattern, because one 
common case is to add a whole subdirectory, and thus clearly the 
.gitignore file must override the pattern.

So it's consistent that it overrides it also for a single filename case, 
no?

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed May 17 08:28:49 2006

This archive was generated by hypermail 2.1.8 : 2006-05-17 08:29:09 EST