Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>VS Code ExtrasNew to Visual Studio Code? Get it now.
VS Code Extras

VS Code Extras

akilin

|
4 installs
| (0) | Free
Personal VS Code addons.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-extras

Personal use only. Please don't install this extension. It's a collection of tweaks for my own setup. Things may change or break without notice, and I don't offer support.

Personal VS Code addons, packaged as one extension (akilin.vscode-extras).

Addon What it does
git-changes-autoclose After a commit, closes the Git: Changes tabs if the repository is clean, and the single-file diffs of files that no longer have changes.
git-on-workspace-open When a window opens, shows the uncommitted changes, or pulls if there are none.

git-changes-autoclose

After a commit, if the repository has no changes left (staged, unstaged, untracked or merge), every tab whose title starts with Git: is closed. Those are the multi-diff editors opened by git.viewChanges, git.viewStagedChanges and git.viewUntrackedChanges, titled like Git: Changes (0 files). After a clean commit they're all empty.

After any commit, even one that leaves other changes behind, single-file diffs whose file no longer has that change are closed:

  • an unstaged diff (file.ts (Working Tree)) closes if the file has no unstaged changes left,
  • a staged diff (file.ts (Index)) closes if the file has no staged changes left.

Files with a merge conflict are never closed. Diffs against a specific commit (from the Timeline or history views) and untracked files (opened as plain editors) are left alone.

  • A commit is detected as HEAD moving to another commit, so commits from a terminal count too. So do checkout, pull and reset, if they leave the repository clean.
  • Discarding or stashing the last change doesn't move HEAD, so the tabs stay open.
  • The tab is matched by title, since the API has no type for multi-diff editors. Only the Git prefix is matched because the rest (Changes) depends on the display language.
  • With several repositories open, a clean commit in one closes the Git: tabs of all of them. Single-file diffs are only closed for the repository that committed.
  • The Git Changes Autoclose output channel logs each HEAD move, the change counts and the open tab titles.

git-on-workspace-open

When a window opens (including Developer: Reload Window), it looks at the workspace's git repository:

  • Uncommitted changes (staged, unstaged, untracked or merge): it opens one multi-diff editor and then the Source Control view, so the commit message box has focus. The editor shows the staged changes if there are any, otherwise the unstaged changes (which include untracked files by default), otherwise the untracked changes (with git.untrackedChanges: separate).
  • No changes: it fetches and pulls the current branch. It never pushes.
    • Only for repositories whose origin is on GitHub under the publisher's account (github.com/akilin/...). Other repositories still get their changes shown, but are never pulled.
    • Nothing is done for a detached HEAD, a branch without an upstream, or a branch that is up to date or only ahead.
    • If the branch has diverged from its upstream, the merge is dry-run first with git merge-tree (git 2.38 or later). The pull only happens if it would merge without conflicts, so a conflict is left for your next manual pull. A clean pull creates a merge commit without asking. If pulls rebase (pull.rebase or branch.<name>.rebase), pull.ff is only, neither pull.rebase nor pull.ff is set, or git is too old, a diverged branch isn't pulled.

Notes:

  • Only windows with a single workspace folder that is the root of a git repository are handled. Multi-root windows, folders inside a larger repository and repositories nested inside the folder are ignored.
  • Nothing is shown on success or failure (offline, authentication). The Git On Workspace Open output channel logs what was done and why something was skipped.
  • Turn it off with "vscode-extras.gitOnWorkspaceOpen.enabled": false, for example in a workspace's settings.

Install

It's a workspace extension, because its addons need the built-in Git extension, which runs where the repository is. In an SSH or Dev Container window, install it on the remote side (Install in Dev Container / SSH in the Extensions view).

If the old standalone akilin.git-changes-autoclose extension is installed, uninstall it. Otherwise both will run.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft