Thread (9 messages) flat view 9 messages, 3 authors, 2016-06-15

Re: How to find out which gitignore blocks my git-add

From: Jeff King <hidden>
Date: 2016-06-15 22:46:07

On Fri, Feb 06, 2009 at 10:38:45AM +0100, Gonzo wrote:
After doing a "git add file" I get the message:

"The following paths are ignored by one of your .gitignore files:
..."

Is there an easy way to find out which line in which gitignore file  
blocks this add?
No, I don't think so.
Would this be a viable addition to "git add -v"?
I think it might be useful to be able to get this information. However,
rather than coupling it with "git add", it might make more sense to have
a separate way to query "is this being ignored, and if so, by what
pattern". Then you could use that tool to generally debug your
.gitignore patterns.

I'm not sure how painful it would be to implement. You'd probably have
to record and pass back that information from dir.c:excluded, which is
where we decide whether or not a file is ignored (most of the code calls
it "excluded", but it is the same concept). Want to take a stab at
writing a patch?

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help