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

Re: refining .gitignores

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 15, 2007, 20:40 UTC
Message-ID
<alpine.LFD.0.9999.0711151237550.4260@woody.linux-foundation.org>
In-Reply-To
<80ejerdzjd.fsf@tiny.isode.net>
On Thu, 15 Nov 2007, Bruce Stephens wrote:
>
> They are in the index.  What I want is a list of files which are known
> to git, which are matched by the default rules (in particular the
> .gitignore files).
Ahh.

*All* the .gitignore rules are purely about files that git does not already know about. Once git tracks a pathname, the ignore rules simply do not matter.

Files that are in the index are simply never ignored. There's no way to ignore them, and in fact, the whole "git add -f" thing is a way to add files to the index and override the exclude rules - at which point git then tracks them regardless of any such exclude rules.

			Linus
Previous: Bruce StephensNext: Bruce Stephens
Message 6 of 9 in “refining .gitignores”
  1. Bruce StephensNov 14, 2007
  2. Alex RiesenNov 14, 2007
  3. Bruce StephensNov 15, 2007
  4. Alex RiesenNov 15, 2007
  5. Bruce StephensNov 15, 2007
  6. Linus TorvaldsNov 15, 2007
  7. Bruce StephensNov 15, 2007
  8. Alex RiesenNov 15, 2007
  9. Linus TorvaldsNov 15, 2007

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.