Idea-gitignore: un-ignored files/directories overridden in subdirectories are still hidden

Created on 12 Jan 2018  路  3Comments  路  Source: JetBrains/idea-gitignore

Description

Subdirectories with .gitignore files that un-exclude files/directories do not then show those files.

Steps to Reproduce

  1. Create a top-level .gitignore file that excludes foo.txt
  2. Create a foo.txt file inside of a few nested directories.
  3. Confirm that foo.txt is hidden from view
  4. Create a .gitignore file in the same directory as foo.txt, with an exclusion marker (i.e. !foo.txt) to prevent it from being ignored

Expected behavior:

I expect to see foo.txt appear in the directory listing, now that it is un-ignored.

Actual behavior:

foo.txt is still ignored

Reproduces how often:

Always

Versions

Plugin:

2.3.2

IDE:

PyCharm 2017.3.2 (Professional Edition)
Build #PY-173.4127.16, built on December 18, 2017
Licensed to CookBrite Inc. / Chris Petersen
Subscription is active until January 11, 2018
JRE: 1.8.0_152-release-1024-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

OS:

Mac OS X 10.13.2

Additional Information

n/a

Most helpful comment

I can also reproduce this with a single top-level .gitignore file excluding a file from an ignored directory

ignored-dir/*
!ignored-dir/foo.txt

All 3 comments

I can also reproduce this with a single top-level .gitignore file excluding a file from an ignored directory

ignored-dir/*
!ignored-dir/foo.txt

Any news on this? There is a general pattern in having

some-dir/*
!some-dir/.gitkeep

in your .gitignore

This plugin not used to highlight gitignored files (also relates to Mercurial) anymore. IDEA have bundled support for highlighting (see https://youtrack.jetbrains.com/issue/IDEA-116425).
The highlighted color is olive green.
The mentioned pattern

some-dir/*
!some-dir/.gitkeep

will work since IDEA request Git to retrieve ignored files.

Was this page helpful?
0 / 5 - 0 ratings