Gitignore Reveal
Selectively reveal gitignored files in the VS Code Explorer.
VS Code's built-in explorer.excludeGitIgnore hides all gitignored files with no exceptions. This extension replaces that with fine-grained control — hide files based on .gitignore while keeping the ones you need visible.
Features
| Feature |
Description |
| Automatic .gitignore sync |
Parses .gitignore and applies patterns to files.exclude automatically. |
| Whitelist patterns |
Specify patterns to keep visible even though they are in .gitignore. |
| Comment markers |
Add #@show in .gitignore to whitelist patterns without editing settings. |
| Block markers |
Use #@show-start / #@show-end to whitelist multiple patterns at once. |
| Hide .gitignore itself |
Optionally hide the .gitignore file from the Explorer tree. |
| Open .gitignore |
Quickly open .gitignore via command — with picker for multi-root workspaces. |
| Multi-root workspace |
Works across all workspace folders independently. |
Quick Start
- Install the extension.
- When prompted, allow the extension to disable
explorer.excludeGitIgnore (they overlap).
- The extension automatically syncs
.gitignore patterns to files.exclude.
- To reveal specific files, use any of the methods below.
Usage
Method 1: Whitelist in Settings
Add patterns to the whitelist in Workspace Settings. You can paste patterns directly from .gitignore:
{
"gitignoreWhitelist.whitelist": [
"sim/result/*.log", // exact .gitignore pattern
"sim/debug.*" // another exact pattern
]
}
Add #@show above a pattern in .gitignore to reveal it — no settings editing needed:
sim/*.log
#@show
sim/result/*.log ← visible in Explorer (marker above)
sim/result/*Log ← hidden (no marker)
For multiple patterns, use block markers:
#@show-start
sim/novas.conf ← visible
sim/novas.rc ← visible
#@show-end
sim/debug.* ← hidden
Note: Git treats # lines as comments, so markers do not affect git behavior.
Commands
Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and search for:
| Command |
Description |
Gitignore Reveal: Sync Explorer Visibility |
Manually refresh the Explorer file visibility. |
Gitignore Reveal: Remove All Managed Excludes |
Remove all files.exclude entries managed by this extension. |
Gitignore Reveal: Open .gitignore |
Open .gitignore — shows a picker if multiple exist. |
Settings
All settings are workspace-scoped (not available in User settings).
| Setting |
Type |
Default |
Description |
gitignoreWhitelist.whitelist |
string[] |
[] |
Patterns to keep visible. Paste from .gitignore or use regex. |
gitignoreWhitelist.useRegex |
boolean |
true |
Also match whitelist entries as regular expressions. |
gitignoreWhitelist.autoSync |
boolean |
true |
Auto-refresh when .gitignore changes. |
gitignoreWhitelist.hideGitignoreFile |
boolean |
false |
Hide .gitignore itself in the Explorer. |
gitignoreWhitelist.inlineMarker |
string |
@show |
Comment marker keyword for in-file whitelisting. |
How It Works
- Reads
.gitignore from each workspace folder.
- Converts patterns to
files.exclude entries.
- Skips patterns that match the whitelist or have a comment marker.
- Updates
files.exclude in workspace settings.
This replaces explorer.excludeGitIgnore — that setting should be disabled when using this extension.
Installation
From .vsix file
code --install-extension gitignore-reveal-1.0.0.vsix
From source
cd gitignore-reveal
npm install
npm run compile
npm run package
code --install-extension gitignore-reveal-1.0.0.vsix
Development
- Open this folder in VS Code.
- Press
F5 to launch the Extension Development Host.