Safely snapshot staged diffs, untracked files, and open editor tabs before switching Git branches, and auto-restore your exact workspace upon return for VS Code.
✨ Features
🔀 Zero-Loss Branch Switching (Alt+Shift+G): Instantly switch branches without fear of lost work. Automatically snapshots in-progress diffs and open editor tabs before switching.
📂 Full Editor Tab State Preservation: Captures every open editor tab and view column split. When you switch back to that branch, all your tabs re-open in their exact layout.
📦 Untracked File Protection: Unlike standard git stash which can lose new uncommitted files, Smart Git Snapshotter preserves new untracked files safely.
🔄 Auto-Restore upon Return: Returning to a previously snapshotted branch automatically detects and reloads your previous context.
⚡ Discreet Status Bar Widget: Displays $(git-branch) Snapshot in the status bar for instant 1-click branch switching.
⌨️ Shortcuts & Commands
Command
Title
Default Shortcut
gitSnapshotter.snapshotAndSwitch
Snapshot & Switch Branch 🔀
Alt+Shift+G (Cmd+Shift+G on Mac)
gitSnapshotter.createSnapshot
Take Snapshot of Current Branch & Tabs
Command Palette
gitSnapshotter.restoreSnapshot
Restore Branch Snapshot (Diffs & Tabs)
Command Palette
gitSnapshotter.listSnapshots
View All Branch Snapshots
Command Palette
⚙️ Configuration Settings
Configure in VS Code Settings (Ctrl+, -> search Git Snapshotter):
gitSnapshotter.autoRestoreOnSwitch: Automatically restore previously saved editor tabs and diffs when returning to a branch (default: true).
gitSnapshotter.includeUntrackedFiles: Preserve new untracked files inside snapshots (default: true).
💖 Support & Sponsor
If this extension saves you time and prevents lost Git work, please consider sponsoring: