GitCharm
Bring the IntelliJ IDEA Git UI and workflow to VS Code / Qoder.
English · 简体中文
What's New
Search is faster, clearer, and starts in the branch you are using
- Search without losing your place. Results highlight the matching text in commit subjects. Filtering keeps the existing list visible while it updates, avoids re-reading branches and other repository state, and repeated identical searches reuse the cached result.
- Open the history you expect. A first-time panel opens on the checked-out branch. “All Branches” is the first row in the branch tree, and the Reflog dialog can switch between the selected branch’s record and
HEAD.
Overview

GitCharm provides a three-panel Git log view:
- Left · Branch tree — hierarchical tree grouped by
HEAD / Local / Remote, plus stash and worktree sections at the bottom, ahead/behind arrows (▲▼) and commit-count badges; a toolbar button narrows the tree to the branches you favorited
- Center · Commit list — Canvas-rendered commit graph showing message first line, author avatar and relative time, with message / author / path / date-range filters (the search box carries
.* and Cc switches for regex and case-sensitive matching); refs sit after the message and fold into a single badge (+N, hover lists every branch and tag)
- Right · Commit details — full commit info (including the branches and tags the commit sits on), changed file list (added/deleted line counts) and diff entry
Screenshots
Commit context menu (single) — right-click a commit row for Show Diff / Cherry-Pick / Reset / New Branch, plus Amend message & Drop on HEAD

Commit context menu (multi-select) — select several commits then right-click for batch Cherry-Pick / Drop / Squash

Branch context menu — right-click a branch node for Checkout / Rename / Delete / Merge / Rebase / Push / Pull

Push dialog — review outgoing commits and their changed files before pushing: files on top, commit info below, both scrollable; switch flat / tree view in the header (force-push available when behind). All four dialogs (push, compare, reflog, file history) can be resized by dragging their edges, and the push / compare dialogs have draggable splitters between panes, and their detail pane folds away when you want more room for files; sizes last for the current session only

Editor context menu — GitCharm actions available from the code editor right-click

Blame gutter — click a line number to reveal the last commit that touched it, with a jump-to-commit link

Conflict handling — merge / rebase / cherry-pick conflicts surface in a persistent status bar with Continue / Abort

Features
Git Operations
- Branches: create, checkout, rename, delete, merge into current, rebase onto, push (force push offered when behind the remote), pull, fetch, update (safe fast-forward for non-current branches)
- Remotes: add a remote, edit its URL, rename or delete it right from the push dialog; switching the target remote recomputes the commit preview, and pushes / pulls use the branch's actual tracking remote instead of a hard-coded
origin
- Protected branches: force-pushing or deleting a branch that matches
idea-git.protectedBranches (default main / master, * wildcards supported) asks for one more confirmation
- Commits: show diff (every file the commit touched, listed in one multi-diff page), cherry-pick (multi-select batch + conflict-resumable), squash (the selection splits into runs of neighbouring commits and each run folds in place — commits you did not select keep their own message and position, so squashing two old commits no longer rewrites the newest one), drop commit, amend message, revert commit (single or several, newest first), reset to commit — also runnable straight from the command palette, which offers the last 50 commits to pick from — open the commit or a branch on the remote web page
- Reflog: open the operation log for the selected branch or
HEAD in one dialog — switch between the two scopes without closing it; any row can be diffed, branched from or reset to, so work a reset --hard hid is recoverable
- Tags: create lightweight or annotated tags on a commit, and a Manage Tags dialog that lists local and remote tags in one table (remote only / local only / pointing elsewhere / in sync, "Differences only" on by default) with per-row fetch, push, overwrite local, delete local and delete remote — in-sync rows included. Pushing reads the remote first: a tag it already has at the same commit is skipped, one it has at a different commit is never overwritten by a batch, and a tag whose commit is not on that remote's branches is not sent at all. Deleting asks whether the remote goes too (the remote half runs first, so a network failure leaves your local tags untouched). Annotated tags are compared through their peeled commit, so they stay correct after
git gc and their badges sit on the right commit
- Stashes: a third section in the branch tree listing the stack, a toolbar button to stash the current changes (optionally including untracked files), and apply / pop / drop per row — changes made with
git stash in a terminal are picked up automatically; click a stash to list its files (untracked included) in the right pane and preview any file's diff before applying
- Worktrees: every checkout of the repository is listed at the bottom of the branch tree — double-click one to open it in a new window, right-click to remove it, and check out any non-current local branch in a new worktree; removal is validated against git's registry and asks once more before force-deleting uncommitted changes
- Files: compare file with another branch, compare with the local working copy, show the current file against its last commit (editor / Explorer right-click), pick a single file from a commit, jump to the file in your working tree (entries for files that no longer exist there are greyed out), open the file exactly as it stood in that commit — read-only and scrolled to the first line the commit touched, which is how you read code the working tree no longer has, open the file's cross-branch history in the editor's Timeline, view diff introduced by a single commit
- Blame: inline annotation of last author & date per line, full commit info on hover, and clicking an annotation re-roots the commit list on that commit — its children above, its ancestors below, the commit itself selected in the middle. With word wrap on, the annotation sits at the end of each line so wrapped continuations stay aligned; with it off it stays in a fixed left column
- Line history: select lines and press
Alt+H for a panel listing every commit that rewrote them — each revision's text previewed, the diff scoped to those lines (whole file with one click), uncommitted edits pinned on top, and one click to re-root the commit list on that commit or open the native diff
- Instant open: the page of history you last saw is painted from disk before any git command runs, and only when the branch tip it was taken from hasn't moved — the live load then replaces it. Branch names come straight off the filesystem and the ahead/behind arrows arrive a moment later
- Details keep up: selecting one commit skips the history-ordering walk a single commit doesn't need; selecting several runs ordering, details and files side by side. The merged file list still comes out in history order, oldest first
- Filesystem refs: resolves the git directory (plain clones, linked worktrees, shared
commondir) and parses its refs (loose + packed-refs) directly — hundreds of branches stay smooth, no flood of git rev-parse subprocesses
- No built-in git extension needed: GitCharm never activates or reads
vscode.git; branch lists, the current branch and ahead/behind counts all come from our own refs reader and a single for-each-ref, so the panel works even with the built-in Git extension disabled
- Smart cache: branch info persisted to workspace state (Memento), instantly available after restart; a filesystem watch on the git directory drops stale caches when you commit, fetch or switch branches elsewhere
- No idle subprocesses: git availability is remembered across sessions, in-progress operations are detected by reading
.git state files, and a re-shown panel replays its cached graph unless the displayed tip actually moved — the first load records that tip itself, so a visibility event right after startup no longer re-runs the same query
- Canvas graph: pixel-precise commit graph rendered on Canvas with high-DPI support, several times faster than SVG/DOM
Experience & Reliability
- Bilingual UI: fully localized interface, follows editor language or set manually
- Session restore: reopening the panel within a couple of hours brings back the last selected branch, commit and its file list — down to the file row you were reading and how far that list was scrolled, even if you closed the panel in the same second you clicked it
- Keyboard navigation: Tab moves between the branch tree, commit list and file pane; arrows walk rows, Home / End / PageUp / PageDown jump, Enter opens the diff, and Shift+arrows extend a commit range
- Favorites: mark branches from the branch row's context menu, then use the toolbar button to narrow the tree to just those — the button stays highlighted while the filter is on, and tells you how to mark a branch when nothing is favorited yet
- IDEA-style search box:
.* treats the keyword as an extended regular expression and Cc makes it case-sensitive, both living inside the box so the rule you are searching under is visible while you type. The default is a literal substring match — ( . * are characters, not syntax — matching text is highlighted in commit subjects, and both switches are part of the filter, so they survive re-showing the panel, a branch switch and a cached page
- Search keeps its context: filtering leaves the old commit list readable while results load, does not refresh the branch tree or divergence arrows, and avoids the full topology sort used by the unfiltered graph; an identical search reuses its cached page
- The filter bar never wraps: when the commit column narrows, author / path / date move into a
> popover instead of stacking into two rows and eating a screenful of the list. The chevron lights up when a filter you cannot currently see is still in effect, and the commit column has a minimum width the splitter will not let you squeeze past
- An exit for an empty result: nothing matched means the empty state hands you a "clear all filters" button, and every filter that is actually applied puts an accent edge on its own toolbar control — a short list always has a reason
- All branches in one list: the first row in the branch tree puts every branch's commits into the same list, so a search spans all of them; when a single-branch filter finds nothing, the empty state offers "Search all branches" instead of sending you to find that option in the tree. Without a saved view, the panel opens on the checked-out branch
- Ahead/behind arrows: shown for branches that differ from their remote twin, including those without a configured upstream
- Two file list views: changed files as a directory tree or as a flat full-path list, switchable in the detail panel and in the push / compare dialogs; the header (count + switch) stays pinned while scrolling in any direction
- Collapsible details: in the push and compare dialogs the info pane below the files folds into a single bar with one click, handing its height to the file list; the fold is remembered per dialog for the current session
- Theme-aware file icons: changed files borrow the icons of the active file-icon theme — installed themes as well as the built-in one, font-based and SVG-based alike; folders use a matching two-tone glyph, and the checked-out branch gets a filled branch icon
- Never squeezed out: the graph column is capped and can be hidden entirely (persisted), so repositories with many branches still show full commit messages
- Works without a repository: the panel and the status bar entry are always present; a folder without
.git gets a guided page that can run git init for you
- IDEA-style visuals: 6–12px radii, smooth transitions, hover micro-animations, yellow tag badges — and a selected row you cannot miss: over the theme's selection colour come a blue wash, an accent bar on the reading side and a bolder label, which matters in light themes where the selection colour almost equals the editor background
- Pre-rebase check: detects uncommitted changes before rebasing to avoid failures
- Unified conflict handling: merge / rebase / cherry-pick conflicts are detected in one place, a persistent top status bar offers Continue / Abort, and the conflicted files are opened directly in the editor (up to 10 tabs) so the built-in merge-conflict code lenses can be used — the panel never switches you into another view
- The panel follows real git state: resolve the conflicts and commit in your own terminal and the operation bar retracts on its own once git's state files are gone, while the commit list reloads as soon as the displayed branch tip moves — keeping your selection, detail panel, folds and scroll position instead of jumping back to the top
- Shell-free execution: every git command runs via argv
spawn, eliminating argument injection
- Long reads can be stopped: a query that takes noticeable time shows a cancellable notification, and cancelling kills the git subprocess that was actually running — quick lookups show no notification, write and network operations are never cancellable, and a cancelled read leaves no error toast and no stuck spinner
- Menus ordered by use: context menus run from the actions you reach for most to the destructive ones, and a branch menu only offers what the repository can actually do — no remote means no Pull / Push / Open on remote, and a branch without an upstream says "First push"
- A row's context menu keeps your selection: right-clicking one of several selected commits operates on the whole group instead of collapsing the selection down to that row
- Stale lock files, handled with a question: if a write hits a
.lock file left behind by a killed git process, GitCharm asks once, then deletes it and retries the same command — no hand-cleaning inside the git directory
- Own credential prompts: when a remote asks for a username, password or token, the extension shows its own input box (masked for secrets) instead of relying on the built-in Git extension — cancelling is reported as a clear outcome, with a hint to configure a credential helper or switch to SSH
- Full error detail on demand: the error notification stays short, while the complete git output (credentials redacted) goes to the GitCharm output channel, reachable from a Show Log button on the notification
- Optional background fetch: set
idea-git.autoFetchMinutes and the panel fetches from the remote every N minutes while it is open, refreshing the branch tree and the ahead/behind arrows. Silent by design — no credential prompt, no error toast, and no subprocess at all when the repository has no remote
- Several repositories in one workspace: whether they come from several workspace folders or from a plain parent directory holding a dozen sibling projects, GitCharm discovers them all and puts a repository switcher above the branch tree (and
GitCharm: Switch Repository in the command palette); the choice is remembered per workspace, and switching clears what belonged to the other repository instead of reusing branch names and hashes that only look valid
Requirements
- VSCode ≥ 1.66.0, or Qoder latest
- Git ≥ 2.0.0
- No dependency on the built-in vscode.git extension — it may be disabled
Installation
From the Marketplace (recommended)
Search GitCharm in the extensions panel (full name GitCharm — IDEA Git Log & Graph, publisher liugui) and install.
From a VSIX file
- Download
git-charm-<version>.vsix
- Run Extensions: Install from VSIX… from the command palette
- Pick the file and reload the window
Usage
- Open a workspace containing a Git repository — a folder without one still opens the panel and offers
git init
- Click the GitCharm tab in the bottom panel to reveal the three-panel log view
- Tree nodes: single-click folders to expand, double-click a branch to switch; right-click a node or commit row for context actions
- Toolbar filters (message / author / path / date range) apply on Enter, and the boxes always show what is actually in effect: re-showing the panel no longer leaves empty boxes over a still-filtered list, and clearing a box back to empty applies immediately. The search box carries its own
.* / Cc switches, and when the column gets narrow the other three move behind >
Common Actions
| Action |
Entry |
| Switch branch |
Double-click branch in tree, or right-click → Checkout |
| View commit details |
Click a commit row |
| Show commit diff |
Right-click commit → Show Diff (all files of that commit) |
| Merge / Rebase |
Right-click branch → Merge into Current / Rebase onto |
| Push / Pull |
Right-click branch → Push / Pull |
| Cherry-pick |
Multi-select commits → right-click → Cherry-Pick |
| Squash |
Multi-select commits → right-click → Squash |
| Drop / Amend commit |
Right-click commit row (only near HEAD) |
| Compare file with branch |
Editor / Explorer right-click → GitCharm → Compare with Branch |
| Compare a file's change in a commit |
Commit detail (third panel) → double-click a file (images, jars and other binary files get a note instead of a text diff) |
| Read a file as it stood in a commit |
Commit detail (third panel) → right-click a file → Open Historical Version (Read-only) — lands on the first line the commit touched, and works for files the working tree no longer has |
| Compare file with local copy |
Commit detail (third panel) → right-click a file → Compare with Local File |
| Show a file's uncommitted changes |
Editor / Explorer right-click → Show Changes |
| Pick a file from a commit |
Commit detail (third panel) → right-click a file → Cherry-Pick File |
| View file history |
Editor / Explorer right-click → GitCharm → File History — GitCharm's own panel by default (commit list + the selected commit's changes); idea-git.fileHistory switches it to VS Code's Timeline |
| View history of selected lines |
Select lines in the editor → Alt+H, or right-click → GitCharm → Selected Lines History |
| Manage local and remote tags |
Toolbar → Manage Tags… — one table for both sides, with per-row fetch / push / overwrite / delete |
| Push or delete tags |
Toolbar → Push Tags… / Delete Tags… (deleting asks whether the remote goes too) |
| Toggle blame |
Editor right-click → Toggle Blame, or click the line-number area |
Settings
Search idea-git in settings:
| Setting |
Description |
Default |
idea-git.cache.enabled |
Cache branch info for faster startup (persisted; refreshed on repo changes or Git operations) |
true |
idea-git.prefetchOnStartup |
Load the panel's first page right after activation so it opens without waiting; adds a few Git commands at startup |
true |
idea-git.pullStrategy |
Update strategy when pulling: merge or rebase |
merge |
idea-git.fileHistory |
What the File History command opens: custom (GitCharm's panel) or native (VS Code's Timeline) |
custom |
idea-git.language |
UI language: auto / zh-cn / en |
auto |
idea-git.debug |
Enable debug logging to the extension host console |
false |
idea-git.autoFetchMinutes |
Fetch from the remote every N minutes while the panel is open (silent; 0 disables) |
0 |
idea-git.protectedBranches |
Branch patterns that get an extra confirmation before force-push or delete (* wildcards supported) |
["main", "master"] |
Development
npm install # install dependencies (includes @vscode/vsce)
npm run compile # compile TypeScript to out/
npm run lint # ESLint
npm test # node:test unit tests
npm run package # build VSIX
Press F5 in VSCode / Qoder to launch the Extension Development Host (config in .vscode/launch.json).
Note: after changing out/ or media/, fully restart the development host — it runs the previously loaded code.
Tech Stack
TypeScript · VSCode Extension API · Git CLI · Webview (Canvas rendering)
License
MIT · Full history in CHANGELOG.md
简体中文
在 VSCode / Qoder 中复刻 IntelliJ IDEA 的 Git UI 与工作流。
新增功能
搜索更快、更清楚,打开面板直达当前分支
- 搜索结果一目了然:提交信息中会高亮匹配词;筛选时旧列表保持可读,避免重复读取分支等仓库状态,相同搜索条件直接复用缓存结果。
- 打开面板就是熟悉的历史:首次打开默认查看当前检出的分支;「全部分支」放在分支树第一行;Reflog 对话框可在「选中分支」与
HEAD 的操作记录间切换。
概览

GitCharm 提供一个三栏式的 Git 日志面板:
- 左栏 · 分支树:按
HEAD / 本地 / 远程 分组的层级树,底部另列贮藏与工作树,带超前/落后箭头(▲▼)与提交数徽标;工具栏可把树收窄到收藏的分支
- 中栏 · 提交列表:Canvas 绘制的提交图谱,含消息首行、作者头像、相对时间,支持消息 / 提交人 / 路径 / 日期区间筛选(搜索框内嵌
.* 正则与 Cc 区分大小写两个开关);分支与标签排在消息之后,折成一枚徽章(+N,悬停逐条列出)
- 右栏 · 提交详情:选中提交的完整信息(含它所在的分支与标签)、变更文件列表(增删行数)与差异入口
界面截图
提交右键菜单(单选):提交行右键呼出 显示差异 / 精选提交 / 重置 / 新建分支,HEAD 附近另有 编辑提交信息 与 删除提交

提交右键菜单(多选):多选提交后右键,批量 精选提交 / 删除提交 / 合并提交

分支右键菜单:分支节点右键呼出 检出 / 重命名 / 删除 / 合并 / 变基 / 推送 / 拉取

推送对话框:推送前查看待推送提交及其变更文件——上为文件列表、下为提交信息,两块均可上下左右滚动,表头可切换平铺/目录结构(落后远程时可强制推送)。推送、对比、Reflog 与文件历史对话框都可以拖拽边框或内部分隔条调整大小,推送与对比框的详情区还能收起;尺寸与收起状态只在本次会话生效

编辑器右键菜单:代码编辑器右键可用的 GitCharm 操作

行号 Blame:点击行号查看该行的最后一次提交,并提供跳转到提交的链接

冲突处理:合并 / 变基 / 精选冲突统一在顶部持久状态栏提示,提供 继续 / 终止

特性一览
Git 操作
- 分支:新建、检出、重命名、删除、合并到当前分支、变基到…、推送(落后远程时提供强制推送)、拉取、获取、更新(非当前分支可快进时安全更新)
- 远端:在推送对话框里新增远端、修改地址、重命名或删除;切换目标远端会立即重算提交预览,推送与拉取都使用分支真正跟踪的远端,不再写死
origin
- 保护分支:强制推送或删除命中
idea-git.protectedBranches 的分支(默认 main / master,支持 * 通配)时多一次确认
- 提交:显示差异(这次提交改动的全部文件在同一个多文件差异页里列出)、精选提交(Cherry-Pick,支持多选批量 + 冲突持久化恢复)、压缩提交(选中项按"紧挨着的一段一段"各自就地折叠,没选中的提交保持原消息、原位置——压两条早期提交不再改到最新那条的记录)、删除提交、编辑提交信息、回退提交(可多选,按时间从新到旧逐个回退)、修补最近提交、重置到此提交(命令面板也能直接执行,没选中提交时列出最近 50 条供选择)、在远端网页打开该提交 / 该分支
- Reflog(操作记录):工具栏一键看提交列表当前所选分支的操作记录(该分支自己的 movements;没选中分支时是
HEAD——只有 HEAD 记录 checkout 与 reset,正是把工作"藏起来"的两个操作);对话框里任意一行都能查看差异、新建分支或回退过去——被 reset --hard 藏掉的提交还能捞回来
- 标签:在提交上新建轻量或附注标签;「标签管理」把本地与远端列进同一张表(仅远端 / 仅本地 / 指向不同 / 已同步,默认「只看差异」),逐行拉取、推送、覆盖本地、删本地、删远端——已同步的行同样可处理。推送前先读远端:已有且指向同一提交的跳过,指向不同的不会被批量覆盖,所在提交还没在目标远端分支上的根本不推。删除会问是否连远端一起删(先删远端,网络那半失败时本地原样不动)。附注标签按剥开后的提交比对,
git gc 之后依然正确、徽章贴在对的提交上
- 贮藏(Stash):分支树第三分区列出贮藏栈,工具栏一键贮藏当前改动(可选择一并收走未跟踪文件),行上可应用 / 弹出 / 删除;在终端里
git stash 也会自动跟上;单击贮藏即可在第三栏列出其文件(含未跟踪文件),应用或弹出前先预览差异
- 工作树(Worktree):分支树底部列出同一仓库的所有检出,双击在新窗口打开、右键移除;非当前本地分支可一键检出到新工作树。移除前按 git 登记校验,工作树含未提交改动时需再次确认才强制删除
- 文件:与其他分支对比此文件、与当前本地文件对比、查看当前文件与最后一次提交的差异(编辑器 / 资源管理器右键)、从提交中挑选单个文件、跳转到工作区中的该文件(工作区已不存在的文件菜单项灰显)、按那次提交的版本只读打开这个文件并停在本次改动的第一行(工作区里早已删掉的代码也能读)、跨分支查看该文件的全部历史提交(打开编辑器的时间线)、查看单次提交引入的差异
- Blame:行内注解每行的最后修改者与日期,悬停查看完整提交信息,点击把提交列表改根到那条提交——上面是它之后的提交、下面是导致它的提交,选中行落在中间,两个方向都能滚动。开启自动换行时注解显示在行尾,折行的续行不会错位;关闭换行时保持左侧固定列
- 行级历史:选中若干行后按
Alt+H,面板列出改写这些行的全部提交——每行预览该提交时的内容,下方差异默认只看选中行(可一键切整文件),未提交的改动钉在最上面,还能一键把提交列表改根到那条提交或交给原生对比
性能
- 秒开:上一次看的那一页提交历史在任何 git 命令之前就从磁盘画出来,而且只在它所属分支的 tip 没动时才用(真正的加载随后覆盖它);分支名直接读文件系统,ahead/behind 箭头晚一步补上
- 第三栏跟得上:只选一条提交时跳过它不需要的历史排序遍历;多选时排序、详情、文件三路并行。合并出的文件清单仍按历史顺序旧→新排列
- 直读 refs:先定位 git 目录(普通克隆、linked worktree、共享
commondir 都能解析),再直接读 refs(loose + packed-refs),数百分支也不卡死,避免大量 git rev-parse 子进程
- 不依赖内置 git 扩展:全程不激活、不读取
vscode.git;分支列表、当前分支、超前/落后全部来自自研 refs 读取器 + 单条 for-each-ref,禁用内置 Git 扩展也能正常用
- 智能缓存:分支信息持久化到工作区状态(Memento),重启后立即可用;对 git 目录做文件监听,在别处提交 / 拉取 / 切分支时自动失效
- 空闲时不启子进程:git 可用性跨会话记忆,进行中操作靠读
.git 状态文件判断,面板重新显示时只要展示的 tip 没动就直接复用缓存——首次加载自己就会记下这个 tip,所以启动刚结束那一下可见性事件不再重跑同一条查询
- Canvas 图谱:提交图用 Canvas 像素级绘制,高 DPI 自适应,比 SVG/DOM 高效数倍
体验与可靠性
- 中英双语:界面全量本地化,跟随编辑器语言或手动指定
- 会话恢复:短时间内重新打开面板自动恢复上次所选分支、提交及其文件列表(2 小时窗口),连你正在读哪一个文件、文件列表滚到哪里一起回来——哪怕你是在点开那一行的同一秒里关掉了面板
- 三栏键盘导航:Tab 在分支树、提交列表与文件列表之间切换;方向键选行,Home / End / PageUp / PageDown 跳转,Enter 打开差异,Shift+方向键扩展提交范围
- 收藏分支:分支行右键打星,工具栏"只看收藏的分支"按钮把树收窄到这些项,筛选生效时按钮高亮;一个都还没收藏时直接告诉你怎么收藏
- IDEA 式搜索框:
.* 把关键词当正则表达式匹配、Cc 区分大小写,两个开关长在框里——正在按什么规则搜,输入的时候就看得到。默认是字面子串匹配,( . * 是字符不是语法,不再因为一个左括号报正则错误;命中词会在提交信息首行高亮;开关与关键词同属筛选条件,重新显示面板、换分支、复用缓存页都不会拿到错的那份答案
- 筛选栏不再叠排:提交列变窄时提交人 / 路径 / 日期收进
> 浮层,而不是换成两排把列表挤掉一屏;看不见的筛选还在生效时 > 会亮。分隔条也不允许把提交列压到没有内容可看
- 筛空了要给出口:一条都不剩时,空态直接提供"清除全部筛选"按钮;真正在生效的筛选会在自己的控件上亮一条强调边——列表为什么这么短总有答案
- 全部分支一起看:分支树第一行的「全部分支」把所有分支的提交放进同一个列表,搜索随之跨分支;没有可恢复的选择时面板默认查看当前检出的分支,单分支下筛不到结果时空态直接给"在所有分支中搜索"
- Reflog 范围切换:操作记录对话框内可切换「选中分支」与
HEAD;前者跟随提交列表范围,后者记录检出与重置等 HEAD 操作
- 超前/落后箭头:与远程同名分支有差异即显示,未配置 upstream 的分支同样计算
- 文件列表两种视图:变更文件可按目录结构折叠浏览,也可平铺显示完整路径,第三栏与推送/对比对话框表头均可切换;表头(数量 + 切换按钮)在任意方向滚动时保持吸附
- 详情可收起:推送与对比对话框下方的详情区点一下折成一条,腾出的高度交给文件列表;收起状态在本次会话内按对话框记住
- 文件图标跟随主题:变更文件直接使用当前文件图标主题的图标(已安装主题与内置主题通用,字体型与 SVG 型都支持),文件夹用配套的双色图标,当前分支则显示实心分支图标
- 不再挤压信息列:提交图列宽封顶且可整体隐藏(持久化),分支再多的仓库也能看全提交信息
- 无仓库也能用:面板与状态栏入口常驻,没有
.git 的文件夹会给出引导页,并可一键执行 git init
- IDEA 风格视觉:圆角 6–12px、平滑过渡、悬停微动效、tag 黄色徽章;选中行也绝不会再看不出来——主题选中色之上再叠一层蓝色渐洗、阅读侧一条强调边并把标签加粗,浅色主题里选中色与编辑器底色几乎同色时也能一眼认出
- 变基前检查:自动检测未提交更改,避免变基失败
- 冲突统一处理:合并 / 变基 / 精选冲突统一检测,顶部常驻状态栏提供"继续 / 终止",冲突文件直接在编辑器打开(上限 10 个 tab)用内置 merge-conflict 代码透镜解决,面板不会把用户切去其他视图
- 面板跟着真实 git 状态走:在自己终端里解决冲突并提交,操作状态栏会在 git 状态文件清掉后自动收起;提交列表也在所选分支 tip 移动时自动重载,并保留当前选中项、第三栏详情、折叠状态与滚动位置,不再跳回顶部
- 无 shell 命令执行:所有 git 命令走 argv
spawn,杜绝参数注入
- 查得久的可以停下:久到你能察觉的历史查询会给出一条带取消按钮的提示,按下去就真的把正在跑的 git 子进程杀掉;快的查询不打扰,改历史与走网络的操作不提供取消,取消后不弹错误提示、也不会留下转个不停的加载态
- 菜单按使用频率排:右键菜单从最常点的操作一路排到破坏性操作;分支菜单只给这个仓库真能做的——没配远端就不出现拉取/推送/在远端打开,还没上游的分支直接写成「首次推送」
- 行右键不改选中:在多选出来的几条提交里右键其中一行,菜单作用于整组选择,不会把选择缩成这一行
- 残留锁文件先问再删:写操作撞上被杀掉的 git 进程留下的
.lock 文件时先问一句,同意后删除它并重试同一条命令,不必自己去 git 目录里手动清理
- 自有凭据输入:远端要账号 / 密码 / 令牌时由扩展弹出输入框(机密项掩码、不写日志),不再依赖内置 Git 的凭据提示;取消会明确回报,并提示配置凭据助手或改用 SSH
- 完整错误随时可查:错误通知保持简短,完整的 git 输出(凭据已脱敏)写入 GitCharm 输出通道,通知条上的"显示日志"按钮可直接打开
- 可选的后台定时 fetch:设置
idea-git.autoFetchMinutes 后,面板打开期间每隔 N 分钟静默 fetch 一次,只更新分支树与超前/落后箭头。刻意保持安静:不弹凭据输入、不弹错误提示,仓库没有远端时一个子进程也不 spawn
- 一个工作区里有多个仓库:不管它们来自多个工作区文件夹,还是一个普通父目录下并排的十几个工程,都会被一并发现,分支树上方出现仓库切换器(命令面板另有
GitCharm: 切换仓库),选择按工作区记忆;切换会清掉属于另一个仓库的状态,而不是拿"看着像真的"的同名分支与短哈希继续用。只有一个仓库时这个控件不出现
环境要求
- VSCode ≥ 1.66.0,或 Qoder 最新版
- Git ≥ 2.0.0
- 不依赖内置 vscode.git 扩展,禁用它也能正常使用
安装
方式一:扩展市场(推荐)
在 VSCode / Qoder 扩展面板搜索 GitCharm(完整名 GitCharm — IDEA Git Log & Graph,发布者 liugui)并安装。
方式二:VSIX 离线安装
- 下载
git-charm-<版本>.vsix
- 命令面板执行 Extensions: Install from VSIX…
- 选择文件,重新加载窗口
使用方法
- 打开一个 Git 仓库工作区——没有
.git 的文件夹同样能打开面板,并会提供一键 git init 引导
- 在底部面板点击 GitCharm 标签,即可看到三栏日志视图
- 树节点:文件夹单击展开、分支双击切换;右键节点或提交行呼出对应操作菜单
- 工具栏筛选(消息 / 提交人 / 路径 / 日期区间)按回车生效,框里显示的就是当前真正生效的条件:重新显示面板不会再出现"框是空的、列表却还在按上次的词过滤",把框删空则立刻按不过滤刷新。搜索框自带
.* / Cc 两个开关,列宽不够时另外三格收进 > 浮层
常用操作
| 操作 |
入口 |
| 切换分支 |
分支树双击分支,或右键 → 检出 |
| 查看提交详情 |
单击中栏提交行 |
| 查看提交差异 |
提交行右键 → 显示差异(该提交的全部文件) |
| 合并 / 变基 |
分支右键 → 合并到当前分支 / 变基到… |
| 推送 / 拉取 |
分支右键 → 推送 / 拉取 |
| 精选提交 |
多选提交 → 右键 → 精选提交 |
| 压缩提交 |
多选提交 → 右键 → 压缩提交 |
| 删除 / 改提交信息 |
提交行右键(仅 HEAD 附近可用) |
| 与其他分支对比文件 |
编辑器 / 资源管理器右键 → GitCharm → 与其他分支对比此文件 |
| 看某文件在这次提交里的改动 |
第三栏变更文件双击(图片、jar 等二进制文件只给一句提示,不开文本对比) |
| 读某文件在那次提交时的样子 |
第三栏变更文件右键 → 打开历史版本(只读),落在本次改动的第一行;工作区里已删除的文件同样能读 |
| 与本地文件对比 |
第三栏变更文件右键 → 与当前本地文件对比 |
| 看当前文件未提交的改动 |
编辑器 / 资源管理器右键 → 查看差异 |
| 挑选提交中的单个文件 |
第三栏变更文件右键 → 挑选文件 |
| 文件历史 |
编辑器 / 资源管理器右键 → GitCharm → 文件历史——默认是 GitCharm 自带面板(提交列表 + 所选提交的改动),idea-git.fileHistory 可切到 VS Code 时间线 |
| 查看选中行的历史 |
编辑器中选中若干行 → Alt+H,或右键 → GitCharm → 选中行历史 |
| 管理本地与远端标签 |
工具栏 → 标签管理…——两侧同一张表,逐行拉取 / 推送 / 覆盖 / 删除 |
| 推送 / 删除标签 |
工具栏 → 推送标签… / 删除标签…(删除会问是否连远端一起删) |
| 显示 Blame |
编辑器右键 → 显示提交信息,或点击行号区域 |
设置项
在设置中搜索 idea-git 可调整:
| 配置 |
说明 |
默认 |
idea-git.cache.enabled |
启用分支信息缓存以提高启动速度(缓存持久保存,仅在仓库变化或执行 Git 操作时更新) |
true |
idea-git.prefetchOnStartup |
扩展激活后立即预取面板首屏,打开时无需等待;会在启动时多跑几条 Git 命令 |
true |
idea-git.pullStrategy |
拉取远程分支的更新策略:merge(合并式)或 rebase(变基式) |
merge |
idea-git.fileHistory |
「文件历史」打开的界面:custom(GitCharm 自带面板)或 native(VS Code 时间线) |
custom |
idea-git.language |
界面显示语言:auto / zh-cn / en |
auto |
idea-git.debug |
启用调试日志(输出到扩展宿主控制台) |
false |
idea-git.autoFetchMinutes |
面板打开期间每隔 N 分钟静默 fetch 一次远端(0 表示关闭) |
0 |
idea-git.protectedBranches |
强制推送或删除前需要二次确认的分支模式(支持 * 通配) |
["main", "master"] |
开发
npm install # 安装依赖(含 @vscode/vsce)
npm run compile # TypeScript 编译到 out/
npm run lint # ESLint 检查
npm test # node:test 单元测试
npm run package # 打包 VSIX
在 VSCode / Qoder 中按 F5 启动"扩展开发宿主"进行调试(配置见 .vscode/launch.json)。
提示:改动 out/ 或 media/ 后,开发宿主跑的是旧代码,需完全重启宿主再验证。
技术栈
TypeScript · VSCode Extension API · Git CLI · Webview(Canvas 渲染)
许可证
MIT
完整版本历史见 CHANGELOG.md。
| |