Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Close Unchanged TabsNew to Visual Studio Code? Get it now.
Close Unchanged Tabs

Close Unchanged Tabs

赵天任

| (0) | Free
Close editor tabs whose files are unchanged in Git, keeping dirty and modified files open
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

English | 中文

Close Unchanged Tabs

Close editor tabs whose files are unchanged in Git, and keep the ones that still matter.

Features

  • Tab context menu: right-click a tab → Close unchanged tabs
  • Command Palette: run Close Unchanged Tabs: Close unchanged tabs
  • Works on one editor group at a time (the group you right-clicked, or the active group from the palette)
  • Uses a fresh, path-scoped git status so results match the working tree right away

What stays open

  • Files with Git changes (working tree, index / staged, untracked, merge conflicts)
  • Unsaved (dirty) editors
  • Non-file tabs (Settings, Output, Webviews, etc.)
  • Tabs in other editor groups

Requirements

  • VS Code 1.85+ (or a compatible editor such as Cursor)
  • git available on PATH, or configured via the editor git.path setting
  • The workspace folder must be a Git repository

Usage

  1. Open several files in a Git repo.
  2. Right-click any tab in the group you want to clean up.
  3. Choose Close unchanged tabs.

Only tabs in that group that are clean in Git are closed.

Localization

UI strings follow the editor language. Supported locales include English (default), Simplified/Traditional Chinese, Japanese, Korean, German, French, Spanish, Russian, Portuguese (Brazil), Italian, Polish, and Turkish.

Extension Settings

  • closeUnchangedTabs.gitPath: absolute path to the git executable. Leave empty to use the editor git.path setting, or git on PATH.

Known Limitations

  • Only file: tabs are considered for closing; remote / virtual schemes are left alone.
  • Files outside any known Git repository are treated as unchanged and may be closed (unless dirty).

Release Notes

See the Changelog tab on the Marketplace page, or CHANGELOG.md / CHANGELOG.zh-CN.md.

License

MIT · 中文译本(以英文原文为准)


关闭未修改标签页

关闭 Git 中未修改的编辑器标签页,保留仍需要关注的文件。

功能

  • 标签页右键菜单:右键标签 → 关闭未修改标签页
  • 命令面板:运行 关闭未修改标签页: 关闭未修改标签页
  • 每次只作用于一个编辑器分组(右键所在分组,或命令面板下的当前活动分组)
  • 使用按路径限定的实时 git status,结果与当前工作区一致

会保留的标签

  • Git 中有变更的文件(工作区、暂存区、未跟踪、合并冲突)
  • 未保存(dirty)的编辑器
  • 非文件类标签(设置、输出、Webview 等)
  • 其他编辑器分组中的标签

要求

  • VS Code 1.85+(或兼容编辑器,如 Cursor)
  • PATH 中有 git,或已在编辑器中配置 git.path
  • 工作区文件夹位于 Git 仓库内

用法

  1. 在 Git 仓库中打开若干文件。
  2. 在想清理的分组中,右键任意标签页。
  3. 选择 关闭未修改标签页。

仅会关闭该分组内、在 Git 中干净的标签页。

本地化

界面文案跟随编辑器语言。已支持:英语(默认)、简体/繁体中文、日语、韩语、德语、法语、西班牙语、俄语、葡萄牙语(巴西)、意大利语、波兰语、土耳其语。

扩展设置

  • closeUnchangedTabs.gitPath:git 可执行文件的绝对路径。留空则使用编辑器的 git.path,或 PATH 中的 git。

已知限制

  • 仅考虑 file: 协议的标签;远程 / 虚拟协议的标签不会关闭。
  • 不在任何已知 Git 仓库中的文件会视为未修改,可能被关闭(未保存的除外)。

更新日志

见 Marketplace 页面的 Changelog 标签,或 CHANGELOG.md / CHANGELOG.zh-CN.md。

许可证

MIT · 中文译本(以英文原文为准)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft