Skip to content

.gitignore folder negation not working correctly #3989

@cbargren

Description

@cbargren

Here's an example of what I mean —

.gitignore:

# ignore everything
*

# still search in folders though
!*/

# don’t ignore .c files
!*.c

Folder structure

foo.dll    # ignored
src
  bar.dll  # not ignored, but should be
  foo.c    # not ignored

Output of git status -u:

On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	src/foo.c

Output of git status --ignored -u:

On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	src/foo.c

Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

	foo
	src/bar.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions