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

/* in .gitignore

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Sep 25, 2012, 20:18 UTC
Message-ID
<CAE1pOi1vEGVcg5wn9VjkSVmMO_hparmYP0hn86XwpSpMmB=Peg@mail.gmail.com>
Hi all,

If you add "/*" (or "*") to '.gitignore' Git will ignore '.gitignore'. This means that your '.gitignore' appears to work (which in fact it does) but really it will only work for you because your '.gitignore' will not be added to the repository. You have to override with an explicit "!/.gitignore" for it to work correctly. (Or use "git add -f .gitignore".)

Naturally, this behaviour makes perfect sense: "/*" means everything. Still, I was wondering whether it might be a good idea to make an exception for '.gitignore' itself? Then if somebody *really* wanted to ignore '.gitignore' they could add "/.gitignore" to '.gitignore'?

Cheers, Hilco

Next: Junio C Hamano
Message 1 of 3 in “/* in .gitignore”
  1. Hilco WijbengaSep 25, 2012
  2. Junio C HamanoSep 25, 2012
  3. Hilco WijbengaSep 26, 2012

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.