git/list[1] front-page[2] threads[3] people[4] search[5] about
 

gitignore: negating path patterns

From
Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Date
May 21, 2008, 14:40 UTC
Message-ID
<g11c8p$kgp$1@ger.gmane.org>
Hi there

It seems that negating path patterns in gitignore doesn't work, or I don't understand it (or both). With the attached script, git status (1.5.5.1) reports "dir/a" as new and "dir/b" as untracked. I would rather expect it to report "dir/c" as untracked also.

It seems that "!b" matches to include "dir/b" (reverting the exclusion "*" as expected), whereas "!dir/" does not match to include "dir/c".

What's going on here?
Michael

P.S.: "*" in dir/.gitignore would do what I want, but I want all patterns in one place.

Message 1 of 1 in “gitignore: negating path patterns”
  1. Michael J GruberMay 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.