Git Info Exclude
VSCode extension that adds right-click context menu to quickly add/remove files from .git/info/exclude, just like IntelliJ IDEA.
Why
.git/info/exclude is a per-clone gitignore file — changes stay local and never get committed. Unlike .gitignore, it won't affect your teammates.
Use it to ignore editor configs, build artifacts, or personal scripts that you don't want cluttering git status or .gitignore.
Features
- Right-click → Add to exclude — appears on untracked (new) files/directories in a git repo
- Right-click → Remove from exclude — appears on files already in the exclude list
- Works in Explorer, Editor tabs, and SCM view
- Supports multi-select (batch add/remove)
- Automatically opens
.git/info/exclude after adding for review
Usage
- Open a file or folder under a git repository
- Right-click →
Git: Add to .git/info/exclude
- The file is instantly ignored locally, and the exclude file opens for inspection
To undo, right-click the file again → Git: Remove from .git/info/exclude.
Install
From VSIX (recommended)
Download the .vsix from Releases, then:
Ctrl+Shift+P → Extensions: Install from VSIX... → select the file
Build from source
git clone https://github.com/anomalyco/gitinfoexclude.git
cd gitinfoexclude
npm install
npm run compile
Then press F5 in VSCode to launch Extension Development Host.
Package
npm install -g @vscode/vsce
vsce package
How It Works
- Detects the git root by walking up from the selected file
- Uses
git status --porcelain to check if the file is untracked
- Writes gitignore-style patterns to
.git/info/exclude
- Context menus are conditionally shown via VSCode context keys
License
MIT