Git Safety Net
A VS Code extension that turns dangerous Git operations into a learning moment, not a panic moment.
When you trigger a destructive operation (currently: git push --force), Git Safety Net opens a pre-flight dialog that shows you — in plain language — exactly what is about to happen: which commits get deleted, which files change, who authored the commits being overwritten. It also creates an automatic snapshot so you can undo the operation if you change your mind.
The problem this solves
Mainstream Git GUIs handle destructive operations in one of two ways:
- Hide them entirely (GitHub Desktop) — frustrating once you outgrow the safety wheels.
- Show a generic "are you sure?" dialog (GitKraken, Sourcetree, VS Code built-in) — assumes you already know what you're doing.
Neither teaches. Both leave intermediate users exposed to history-rewriting catastrophes that are hard to undo and harder to explain to teammates.
What Git Safety Net does differently
- Plain-language pre-flight explanation — tells you specifically which commits and files will be affected, not just "are you sure?"
- Visual before / after of what changes on the remote — see the diff before you commit to it.
- One-click undo — every destructive op auto-creates a recoverable snapshot via
git stash and the reflog.
- Contextual micro-lesson — explains why the operation is dangerous, with a "don't show again" graduation path once you've learned.
Status
Early prototype. Currently supports: safe force push.
Planned next: git reset --hard, branch deletion, interactive rebase.
Development
npm install
npm run compile
Then press F5 in VS Code to launch an Extension Development Host with the extension loaded.
Origin
Designed from HCI principles studied in CIT3407 (Human-Computer Interaction). The feature set is the practical realization of the "Contextual Onboarding Widgets for Git Operations" idea from the course's GitHub UI analysis assignment.