# gitignore does not ignore wildcard directory if it is a link

2 messages from 2020-08-21 to 2020-08-21. Participants: voxspox, Junio C Hamano.
Thread: https://gitlist.dev/t/54081

## voxspox, 2020-08-21 13:37

Subject: gitignore does not ignore wildcard directory if it is a link
Message-ID: <0179b688-576b-7423-8824-9b57fe8f92fc@gmx.net>
URL: https://gitlist.dev/e/0179b688-576b-7423-8824-9b57fe8f92fc%40gmx.net

```

Hi,

I start with a scenario:

contents of working copy:

/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
using: 2.25.1 on Linux


regards Knut




```

## Junio C Hamano, 2020-08-21 16:46

Subject: Re: gitignore does not ignore wildcard directory if it is a link
Message-ID: <xmqqa6yo9cao.fsf@gitster.c.googlers.com>
URL: https://gitlist.dev/e/xmqqa6yo9cao.fsf%40gitster.c.googlers.com
In-Reply-To: <0179b688-576b-7423-8824-9b57fe8f92fc@gmx.net>

```
voxspox <voxspox@gmx.net> writes:

> /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.

```
