Stop hand-editing your
|
| Feature | Details |
|---|---|
| 🖱️ One click | Right-click any file or folder and pick Add to .gitignore, in its own section at the bottom of the menu. |
| 📄 Creates the file | No .gitignore yet? One is created at the repository root. |
| 🎯 Precise patterns | Entries are anchored to the repo root (/src/secret.txt, /build/), so only the item you clicked gets ignored, not every file that shares its name. |
| 🧹 Self-cleaning | Ignoring a folder removes the entries inside it that just became redundant. |
| 🛡️ Exclusion-safe | Folders containing ! exclusions are rewritten so the excluded files stay tracked. Verified with git check-ignore. |
| 🗂️ Multi-select | Select several files and folders, add them all in one go. |
| 🔍 Duplicate-proof | Items already ignored (directly or through an ignored parent folder) are detected and skipped. |
| 🙈 Context-aware | The menu only shows up inside a git repository and never on a .gitignore itself. |
🚀 Getting started
Works on any VS Code from 1.20 (January 2018) onward.
- Open a folder that belongs to a git repository.
- Right-click any file or folder in the explorer.
- Click Add to .gitignore.
A notification tells you exactly what was added, cleaned up, or skipped.
🧠 Smart folder handling
Redundant entries? Gone.
Once a folder is ignored, the entries inside it are dead weight. ClickIgnore removes them for you:
# before # after adding "build"
/build/temp.log /build/
/build/cache/
Exclusions? Protected.
Git cannot re-include a file when its parent directory is fully ignored: a naive /build/ entry would silently break your ! rules. ClickIgnore ignores the folder's contents instead and rebuilds the exclusion chain below the new rule, including the un-ignore steps that nested exclusions require:
# before # after adding "build"
!/build/a/keep.me /build/*
!/build/a/
/build/a/*
!/build/a/keep.me
Everything in build/ is ignored, yet build/a/keep.me stays tracked. Exactly what you meant.
❓ FAQ
Does it untrack files git is already tracking?
No. .gitignore only affects untracked files. Run git rm --cached <file> to untrack one.
What about global exclusions like !keep.me?
Patterns that aren't anchored to a specific folder can't be attributed to it, so they are left untouched when you ignore a folder.
Any settings to configure? None. It just works.
🛠️ Development
No build step, no dependencies: clone, open, press F5.
git clone https://github.com/christiansassi/.clickignore
To package and install locally:
npm install -g @vscode/vsce
vsce package
code --install-extension click-ignore-0.0.1.vsix
📝 Release notes
0.0.1
Initial release:
- Add files and folders to
.gitignorefrom the explorer context menu - Redundant-entry cleanup when ignoring folders
- Exclusion-preserving folder rules
- Multi-select support
📜 License
Released under the MIT License.