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

Re: negated list in .gitignore no fun

From
Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
Date
Dec 18, 2008, 22:34 UTC
Message-ID
<200812181634.51351.bss@iguanasuicide.net>
In-Reply-To
<87hc51tajw.fsf@jidanni.org>
On Thursday 2008 December 18 15:53:23 jidanni@jidanni.org wrote:
Show 9 quoted lines
> # head -n 5 .gitignore
> *
> !X11/xorg.conf
> !anacrontab
> !apt/apt.conf.d/10jidanni
> !apt/sources.list
> # git-add .
> But git-status only shows anacrontab got added. None of the files in
> the subdirectories get added.

That's by design. You've chosen to ignore those directories; they match "*" themselves. Thus, 'git add .' doesn't descend into them looking for files.

I wouldn't want to change this behavior because I'll often use a "build" directory and put all generated files in it and just ignore that directory with a single line in .gitignore.

I think the .gitignore you really want is: * !X11 !X11/xorg.conf !anacrontab !apt !apt/apt.conf.d !apt/apt.conf.d/10jidanni !apt/sources.list [...]

But, I haven't tested that.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     
Previous: jidanni@jidanni.orgNext: Linus Torvalds
Message 2 of 4 in “negated list in .gitignore no fun”
  1. jidanni@jidanni.orgDec 18, 2008
  2. Boyd Stephen Smith Jr.Dec 18, 2008
  3. Linus TorvaldsDec 18, 2008
  4. Linus TorvaldsDec 18, 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.