OverviewGit Poison is a VS Code extension that blocks a git commit of any file containing a "Poison Pill" string. Placing a pill stops accidental committing of unfinished TODOs, debug statements, secrets, etc. It also provides navigation to pill locations. FastAll scans use the Git Grep command so this is as fast as normal Git operations. SecureThe code to block commits is in a Git pre-commit hook inside of .git. The hook is always active so poison pills are blocked no matter where the git commit is run. It works in VS Code, external terminals, Git GUI apps, etc. It even works when no VS Code window is running. Excluded Files And FoldersFiles/folders in .gitignore, in addition to the glob patterns in settings, are excluded from the extension actions including Insert Poison Pill, scanning the index for pill counts, and watching for pill changes. Jumping to a pill in an excluded file is not excluded. So jumping finds all pills in the workspace. All File Types Are SupportedPills are not limited to code files. They work in all files containing text, even html, JSON, plain text, etc. It is recommended that you start the pill string with a comment to support placing it in more places. If you want it in JSON I recommend using the JSON Commenter extension written by a great guy. Status BarThe status bar option show S/A where S is the number of pills in staged files. If S is greater than zero then committing will be blocked. A is the number of pills in the entire workspace. Clicking on this status causes a Scan All Files command to be executed. UninstallUnfortunately VS Code does not provide a way for an extension to run cleanup code when it is uninstalled. You should delete the file Commands
Settings
Author: Mark Hahn (eridien)Marketplace: https://marketplace.visualstudio.com/items?itemName=eridien.git-poisonOpen VSX: https://open-vsx.org/extension/eridien/git-poisonRepo: https://github.com/eridien/vscode-git-poisonOriginal Release: September 2025License: MIT |