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

Re: gitignore does not ignore wildcard directory if it is a link

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 21, 2020, 16:46 UTC
Message-ID
<xmqqa6yo9cao.fsf@gitster.c.googlers.com>
In-Reply-To
<0179b688-576b-7423-8824-9b57fe8f92fc@gmx.net>
voxspox <voxspox@gmx.net> writes:
Show 23 quoted lines
> /somefile1
> /test/dir1  (directory)
> /test/dir2  (link to directory)
> /test/dir3  (link to directory)
> /test/file1
>
> I want to ignore all subfolders in "test", thus I modified my .gitignore to:
>
> /test/*/
>
>
>> git status
>
> Untracked files:
>   test/dir2
>   test/dir3
>
>
> Putting "/test/dir3" into .gitignore will work fine.
>
>
> -> It seems that directories are not ignored by a wildcard pattern if
> the directory is a link

This is working as designed, intended and expected, I would think. Git does track symbolic links as the first-class citizen, and dir2 and dir3 in the above example are *not* directories.

Previous: voxspox
Message 2 of 2 in “gitignore does not ignore wildcard directory if it is a link”
  1. voxspoxAug 21, 2020
  2. Junio C HamanoAug 21, 2020

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.