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

Re: [PATCH 4/4] Documentation/gitignore: explain how to un-ignore part of a directory

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 7, 2011, 10:23 UTC
Message-ID
<CACsJy8BND-fg0YoUiSpYo1KiNjt604uQ395+KMTK-E6QP7oSdw@mail.gmail.com>
In-Reply-To
<20111107081132.GD30486@elie.hsd1.il.comcast.net>
2011/11/7 Jonathan Nieder <jrnieder@gmail.com>:
Show 16 quoted lines
> From: Johannes Sixt <j6t@kdbg.org>
> Date: Tue, 5 Apr 2011 23:15:54 +0200
>
> Trying to whitelist a single file pattern in a directory that I was
> otherwise content to ignore, if I try
>
>        /m4/
>        !/m4/virt-*.m4
>
> then 'git add' will keep warning me that I have to use -f.  That is
> because ignoring a directory is much different than ignoring all files
> in a directory, when it comes to later negation patterns:
>
>        /m4/*
>        !/m4/virt-*.m4
>

gitignore.txt is also referred in sparse checkout. And (un)fortunately the former also works in sparse checkout. I don't know, may be you could put this in a subsection or something reference-able so we could mention in sparse checkout document that this part of gitignore.txt does not apply to sparse checkout?

-- 
Duy
Previous: Jonathan Nieder
Message 10 of 10 in “gitignore.5 clarifications”
  1. 0/5 gitignore.5 clarificationsJonathan Nieder, Nov 7, 2011
  2. 1/4 Documentation/gitignore: "foo/" patterns match directories, not files under themJonathan Nieder, Nov 7, 2011
  3. Nguyen Thai Ngoc DuyNov 7, 2011
  4. Junio C HamanoNov 7, 2011
  5. 2/4 Documentation: clarify effect of '/' in gitignore(5) patternsJonathan Nieder, Nov 7, 2011
  6. Nguyen Thai Ngoc DuyNov 7, 2011
  7. 3/4 Documentation: unanchored gitignore patterns match basenameJonathan Nieder, Nov 7, 2011
  8. Nguyen Thai Ngoc DuyNov 7, 2011
  9. 4/4 Documentation/gitignore: explain how to un-ignore part of a directoryJonathan Nieder, Nov 7, 2011
  10. Nguyen Thai Ngoc DuyNov 7, 2011

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.