⚡ GitSnapOne-keystroke Git for VS Code — with AI if you want it, without it if you don't.Draft commit messages, commit and push in one shortcut, manage branches and stashes visually, preview rebases, prepare pull requests and run Git in plain English — all inside VS Code. Bring your own key (Groq · OpenAI · Anthropic) · Run AI locally (Ollama · Tabby) · Or switch AI off entirely — every core feature still works. Contents
🔍 What is GitSnap?GitSnap is a Visual Studio Code extension that removes the repetitive parts of working with Git:
GitSnap is AI-optional by design. AI only drafts text (commit messages, PR descriptions, short summaries) and translates plain-English requests. Everything else is ordinary, predictable Git — and when AI is switched off, each feature falls back to manual input or a built-in template. 🎛 Choose your modeGitSnap works in three ways. You can switch at any time in GitSnap: Open Settings.
🚫 Option A — No-AI modeEverything works without any AI: commit & push, the commit editor, branch dashboard, stashes, log explorer, cherry-pick, rebase preview, worktrees, PR drafts (from a template) and undo. Turn it on:
Or in
What changes:
No AI network requests are made while AI is disabled. 🔑 Option B — Bring Your Own Key (BYOK)You use your own account with a cloud provider. GitSnap has no subscription and no server of its own: requests go straight from your VS Code to the provider.
Set it up (example: Groq):
Faster alternative: run GitSnap: Set API Key and paste the key. It is saved for the currently selected provider. Good to know:
🏠 Option C — Local AI (Ollama or Tabby)AI runs on your own machine or server. Nothing is sent to the internet. Ollama:
Tabby: choose Tabby (self-hosted), set
📦 InstallationRequirements
Install from a
|
| Badge | Meaning |
|---|---|
| ● current | The branch you are on (always listed first) |
| ↑ n / ↓ n | Commits ahead of / behind its upstream |
| ✅ unpushed work, up to date | Has commits to push and is not behind — ready to push or merge |
| 🔄 diverged | Both ahead and behind — pull or rebase first |
| upstream deleted | The remote branch it tracked no longer exists |
| ⚠️ stale >30d | No commits in the last 30 days |
Actions:
- Checkout a branch (refused, with a clear message, if your uncommitted changes would be overwritten).
- + New Branch — choose a name and a start point (current branch or any other). If your team set a naming pattern, non-matching names get a warning.
- Delete asks for confirmation; Force Delete is offered only after Git reports the branch is not fully merged. The current branch can never be deleted.
- ⇣ Fetch All updates remote information; ↻ Refresh reloads the list.
- A filter box appears when you have more than 8 branches.
AI insights (AI mode): one-line tips such as "Rebase onto main before pushing" appear under branches that need attention. The list shows instantly — insights stream in afterwards and never slow it down.
4. 🧰 Advanced Toolkit — Ctrl+K T
Five tools in one panel.
📜 Log Explorer
Search the last 100 commits by author, message text and branch (default: current branch). Text search is literal and case-insensitive, so characters like ( or * are safe to type. Press Enter in any field to search.
📦 Stash Manager
- + Stash Changes with an optional message; tick include untracked to also stash new, untracked files.
- For each stash: View Diff, AI Summary (AI mode), Apply (keeps the stash), Pop (applies and removes it) and Drop (asks for confirmation — this permanently deletes it).
- Stashes are tracked by their unique ID, so if the list changed in the meantime GitSnap refuses the action and asks you to refresh, instead of touching the wrong stash.
- If applying a stash causes conflicts, GitSnap tells you — and a popped stash is kept, so nothing is lost.
🍒 Cherry-Pick
Copy a single commit onto your current branch.
- In Log, search for the commit (use the Branch filter to look at another branch).
- Switch to Cherry-Pick, choose the commit, and click 🍒 Cherry-Pick.
Clear messages cover every outcome: conflicts (with the commands to continue or abort), merge commits (not supported), and commits that are already on your branch (nothing is left half-done).
🔄 Rebase Preview (read-only)
Enter a base branch (e.g. main or origin/main) and click Preview. You see exactly the commits that git rebase <base> would replay, oldest first — commits already on the base are skipped, just as Git would. Nothing in your repository is changed.
🌳 Worktrees
Work on two branches at the same time in separate folders, without stashing.
- Enter a folder outside your repository, e.g.
../my-feature. - Enter a branch: an existing local branch, a remote branch (a tracking branch is created), or a new name (created from your current commit).
- Click + Add Worktree, then Open in New Window in the notification.
Existing worktrees are listed with their branch, commit and locked status.
5. 🔀 PR Prep Assistant — Ctrl+Alt+P
Draft a pull-request title and description.
- Open the panel. Head is your current branch; Base is pre-selected (
main,masterordevelop, local or remote) — change it from the dropdown if needed. - Review the list of commits that are on your branch but not on the base.
- Click Generate PR Description.
- Edit the title and Markdown body, then use 📋 Copy to paste them into GitHub, GitLab or any other host.
With AI you get a written summary; without AI (or if the AI request fails) you get a clean template with commits grouped under Features, Bug Fixes, Refactoring and so on, plus a Testing checklist. GitSnap never submits anything for you.
6. ✨ Natural-Language Git — Ctrl+K N (AI mode)
Describe what you want in plain English:
- "switch to main and fetch latest"
- "create a branch called feature/login from develop"
- "stash my work as wip"
- "show the last 10 commits"
- "undo my last commit"
- "delete branch feature/old"
How it stays safe:
- The AI's answer is converted into a fixed list of supported operations — switch, create or delete a branch, undo last commit, fetch, show log, stash. Anything else is discarded. Nothing is ever run as a raw shell command.
- You see every planned step and can untick any of them.
- Destructive steps (deleting a branch, undoing a commit) require an extra confirmation.
- Steps run in order and stop at the first failure, telling you what had already succeeded.
- Your last 20 requests are offered for one-click reuse in that workspace.
Log output is written to the GitSnap output channel — click Show Output in the notification.
7. ↩️ Undo Last Commit — Ctrl+Alt+Z
Removes the last commit but keeps all its changes staged, so you can fix the message or add a forgotten file and commit again.
- A confirmation shows the commit you are about to undo.
- If that commit is already pushed, you are warned that undoing it locally will make your branch diverge from the remote.
- Works even on the very first commit of a repository.
- Refused while a merge, rebase or cherry-pick is in progress.
8. ⚙️ Settings panel & API keys
- GitSnap: Open Settings — enable/disable AI, choose provider and model, and store or remove the key for each provider.
- GitSnap: Set API Key — a quick prompt that stores the key for the current provider.
⌨️ Keyboard shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| GitSnap menu | Ctrl+K then G |
Cmd+K then G |
| Fast AI Commit & Push | Ctrl+Alt+Enter |
Cmd+Alt+Enter |
| Commit Editor | Ctrl+Alt+C |
Cmd+Alt+C |
| Branch Dashboard | Ctrl+K then B |
Cmd+K then B |
| Advanced Toolkit | Ctrl+K then T |
Cmd+K then T |
| PR Prep Assistant | Ctrl+Alt+P |
Cmd+Alt+P |
| Natural-Language Git | Ctrl+K then N |
Cmd+K then N |
| Undo Last Commit | Ctrl+Alt+Z |
Cmd+Alt+Z |
"Ctrl+K then B" means: press Ctrl+K, release, then press B.
Ctrl+Alt+Enter is inactive while VS Code's Find/Replace or Search box has focus, so Replace All keeps working.
To change any shortcut: File → Preferences → Keyboard Shortcuts and search for "GitSnap".
🛠️ Settings reference
| Setting | Default | Description |
|---|---|---|
gitsnap.ai.enabled |
true |
Master switch for all AI features. false = No-AI mode. |
gitsnap.ai.provider |
"groq" |
groq, openai, anthropic, ollama or tabby. |
gitsnap.ai.ollamaBaseUrl |
http://localhost:11434 |
Address of your Ollama server. |
gitsnap.ai.tabbyBaseUrl |
http://localhost:8080 |
Address of your Tabby server. |
gitsnap.ai.requestTimeoutSeconds |
60 |
Maximum wait for one AI response (5–600). Temporary errors such as rate limits are retried automatically. |
gitsnap.ai.customSystemPrompt |
"" |
Replaces the built-in commit-message instructions (e.g. for another language or style). |
gitsnap.commitTemplate.scopes |
[] |
Preferred commit scopes such as ["auth","api","ui"]; the AI uses them when they fit. |
gitsnap.branchNaming.pattern |
"" |
Regular expression for branch names, e.g. ^(feature\|bugfix\|hotfix)/.+. Non-matching names get a warning; creation still proceeds. |
The model and API key are chosen per provider in the Settings panel and are not part of settings.json.
Team setup — commit a .vscode/settings.json to share conventions:
{
"gitsnap.commitTemplate.scopes": ["auth", "core", "ui", "docs", "infra"],
"gitsnap.branchNaming.pattern": "^(feature|bugfix|hotfix|chore)/.+"
}
Each teammate still uses their own provider and key (or No-AI mode).
🛡 Safety guarantees
GitSnap is built so that a mistake — yours, an AI's or the network's — cannot quietly damage your repository.
- Nothing destructive without confirmation: branch deletion, force delete, dropping a stash, undoing a commit and destructive natural-language steps all ask first.
- Your staging is respected: if you staged specific files, only those are committed.
- No shell, no injection: Git is run directly with validated arguments. Branch names, commit IDs and stash references are checked before use, so input like
--forceis rejected rather than treated as an option. - No hangs: every Git and AI operation has a time limit, and Git is never allowed to wait for a hidden password prompt.
- No collisions: GitSnap actions that change the same repository run one at a time.
- Honest results: if a commit succeeds but the push fails, you are told the commit exists locally.
- Mid-operation awareness: actions that would be unsafe during a merge, rebase or cherry-pick are refused with an explanation.
- Restricted Mode: GitSnap does not run in untrusted workspaces, because Git can execute hooks and commands configured inside a downloaded repository.
🔒 Privacy & security
- API keys live only in your OS keychain via VS Code SecretStorage — one per provider. They never appear in
settings.json, the panels, logs or error messages. - What is sent to AI (only when AI is enabled and you use a drafting feature): the staged diff (trimmed if very large) for commit messages, commit subjects for PR descriptions, a stash diff for stash summaries, branch metadata for insights, and your sentence for natural-language commands.
- Nothing is stored: diffs are held in memory only for the request that needs them. GitSnap has no telemetry and no server of its own.
- Fully offline: with Ollama/Tabby or No-AI mode, nothing leaves your machine.
- Logs: details of failures are written to the GitSnap output channel (View → Output → GitSnap) on your machine only.
🧯 Troubleshooting
| Problem | Solution |
|---|---|
| "No Git repository found" | Open a folder that is inside a Git repository. In multi-folder workspaces, GitSnap uses the repository of the file you have open, otherwise the first folder that is a repository. |
| "Git was not found" | Install Git and make sure git --version works in a terminal, then restart VS Code. |
| GitSnap commands are missing | The workspace is in Restricted Mode — click Trust in the banner or run Workspaces: Manage Workspace Trust. |
| "No API key set for …" | Run GitSnap: Set API Key, or switch to Ollama or No-AI mode. |
| "… rejected the API key" | The key is wrong, expired or for a different provider. Create a new key and store it again. |
| "could not use model …" | The model name is wrong or retired. Pick another in GitSnap: Open Settings, or clear the field to use the default. |
| "Couldn't reach Ollama …" | Start Ollama (ollama serve), check gitsnap.ai.ollamaBaseUrl, and pull the model (ollama pull <model>). |
| AI drafts time out | Increase gitsnap.ai.requestTimeoutSeconds, or choose a smaller, faster model. |
| "The remote has commits your branch does not" | Pull (or rebase) first, then push again. Your commit is already saved locally. |
| "Authentication with the remote failed" | Sign in to GitHub/GitLab in VS Code, set up a credential helper, or configure an SSH key. Test with git push in a terminal. |
| "Git does not know who you are" | Run git config --global user.name "Your Name" and git config --global user.email "you@example.com". |
| "Another Git process is running (index.lock exists)" | Wait for the other Git operation to finish. If none is running, delete .git/index.lock. |
| A panel shows "GitSnap UI bundle not found" | You are running from source without a build — run npm run build and reopen the panel. |
| Anything else | Open View → Output → GitSnap for details. |
❓ FAQ
Do I need an AI provider to use GitSnap?
No. Set gitsnap.ai.enabled to false and every feature except Natural-Language Git works.
Is my code sent anywhere? Only when AI is enabled with a cloud provider and you use a drafting feature — and then only to the provider you chose. With Ollama, Tabby or No-AI mode, nothing leaves your machine.
Does GitSnap ever force-push or rewrite pushed history? No. It never force-pushes. Undo Last Commit is local and warns you if the commit was already pushed.
Will Fast Commit & Push commit files I didn't want? If you staged specific files, only those are committed. If nothing is staged, everything is staged — use the Commit Editor if you want to review first.
Which model should I use?
Start with the default for your provider. On Groq, openai/gpt-oss-20b and llama-3.1-8b-instant are fast; for local use, llama3.2 or qwen2.5-coder work well on most laptops.
Can my team share conventions?
Yes — commit gitsnap.commitTemplate.scopes and gitsnap.branchNaming.pattern in .vscode/settings.json. Keys stay personal.
I used an older version — are my key and model kept? Yes. On first start, a previously saved key is moved to the provider you have selected, and invalid old model names are discarded so the default is used.
👩💻 For developers
Prerequisites
Node.js 20+, Git, VS Code 1.134+.
Commands
npm install # install dependencies (regenerates package-lock.json)
npm run typecheck # type-check extension and webviews
npm test # unit tests + integration tests against real temporary Git repositories
npm run build # build dist/extension.js and dist/webview/*
npm run watch # rebuild on every change
npm run lint # ESLint
npm run package # create gitsnap-<version>.vsix
Press F5 to start an Extension Development Host. Run Developer: Reload Window in that window after rebuilding.
Architecture
src/
├── extension/ Node.js — runs inside the VS Code extension host
│ ├── extension.ts command registration, Fast Commit & Push, Undo, NL Git
│ ├── git/
│ │ ├── runner.ts spawns git: timeouts, non-interactive env, per-repo write lock
│ │ ├── index.ts all Git operations with friendly, typed errors
│ │ ├── parsers.ts parsing of git's machine-readable output
│ │ ├── validate.ts ref / SHA / stash-ref validation
│ │ ├── repo.ts finds the repository to act on
│ │ └── nlExecutor.ts runs validated natural-language operations
│ ├── ai/
│ │ ├── index.ts retries, timeouts, error handling, feature functions
│ │ ├── providers/ Groq/OpenAI/Tabby (OpenAI-compatible), Anthropic, Ollama
│ │ ├── prompts.ts, nl.ts prompts and natural-language plan validation
│ │ └── text.ts, json.ts output cleaning, PR template, robust JSON extraction
│ ├── webview/ panel hosts (CSP, Vite manifest lookup, message routing)
│ ├── secrets.ts per-provider keys (SecretStorage) and models
│ └── log.ts GitSnap output channel
├── webview/ Svelte 5 user interfaces + shared theme.css
├── types/ message contracts and data shapes shared by both sides
└── test/ vscode mock and test helpers
The extension host and the webviews never share runtime state: they communicate only through the typed messages in src/types/webviewMessages.ts. The webviews never receive API keys.
Testing notes
- Git tests create real repositories (including a local "remote") in a temporary folder and are skipped automatically if Git is not installed.
- AI tests replace
fetch, so they never touch the network. vscodeis mapped tosrc/test/vscode.mock.tsinvitest.config.ts.
📄 License
Distributed under the MIT License. Created by RohithSGowda — github.com/rohith-decent/GitSnap.