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

Re: gitignore - how to ignore only in current directory

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
May 23, 2010, 20:36 UTC
Message-ID
<20100523203651.GA13942@atjola.homenet>
In-Reply-To
<AANLkTilGH-Z4IpgosqYPFCl3G2XsKDfAT3pH6vi-wuN8@mail.gmail.com>
On 2010.05.23 21:28:39 +0100, Howard Miller wrote:
> I want to ignore a particular file name in a particular directory.
> However, the same filename may appear in subdirectories and in those
> cases I do *not* want it ignored.

If the pattern contains a non-trailing slash, then the pattern is matched against the whole path (relative to the directory the .gitignore file is in), not just against the filename relative to its parent directory. So if you want to ignore "foo" only in the directory the .gitignore file is in use "/foo" (without the quotes).

Björn
Previous: Howard Miller
Message 4 of 4 in “gitignore - how to ignore only in current directory”
  1. Howard MillerMay 23, 2010
  2. Bruce StephensMay 23, 2010
  3. Howard MillerMay 23, 2010
  4. Björn SteinbrinkMay 23, 2010

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.