百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vscode-better-git-line-blame

> 编程语言
开源

一个 VS Code 扩展,用于为行添加 git blame 信息。

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个 VS Code 扩展,用于为行添加 git blame 信息。

VS Code: Better Git Line Blame

A simple VS Code extension that annotates the current line with git blame information.

It's like the GitLens line annotation feature, but faster.

Install

Get Better Git Line Blame on the Visual Studio Marketplace.

Features

  • Displays line annotations in the same style as GitLens.
  • Optionally shows blame information in the status bar.
  • Caches blame data so annotations are instantaneous.
  • On hover, shows the commit author, date, message, and SHA.
  • Autolinks to issues and PRs on GitHub and GitLab.
  • Includes a "Show diff" link using VS Code's built-in diff viewer.
  • Supports multiple git repositories in the same workspace.
  • Uses git blame --incremental to provide blame quickly and incrementally.
  • Loads commit message lazily without blocking blame annotation rendering.
  • Handles untracked files, unsaved edits, and git branch changes.

Commands

  • Better Git Line Blame: Toggle Inline Annotations
    • Toggle betterGitLineBlame.showInlineAnnotations in your user settings file.
  • Better Git Line Blame: Toggle Status Bar Item
    • Toggle betterGitLineBlame.showStatusBarItem in your user settings file.
  • Better Git Line Blame: Show Commit
    • Show the commit message in a separate editor. Same as clicking on the status bar item.
  • Better Git Line Blame: Show Commit (Plain Text)
    • Like "Show Commit", but in plain text instead of rendering as Markdown.
  • Better Git Line Blame: Show Diff
    • Show the blame's diff for the current file. Same as the "Show diff" link.
  • Better Git Line Blame: Reblame File
    • Rerun git blame on the current file.
  • Better Git Line Blame: Clear Cache
    • Clear all cached git blame data.

Configuration

  • betterGitLineBlame.showInlineAnnotations (default: true)
    • Show git blame information as inline annotations. Hover on the annotations to see more details.
  • betterGitLineBlame.showStatusBarItem (default: false)
    • Show git blame information in the status bar. Click on the status bar item to see more details.
  • betterGitLineBlame.enableHoverMessages (default: true)
    • Show commit details when hovering over inline annotations.
  • betterGitLineBlame.showAuthorAvatar (default: true)
    • Show commit author avatars in hover messages. The avatars are fetched from Gravatar based on email address.
  • betterGitLineBlame.authorAvatarSize (default: 16)
    • Size of commit author avatars in CSS px.
  • betterGitLineBlame.annotateWholeLine (default: false)
    • Attach annotations to the entire line. This prevents flicker when deleting lines, but shows commit details when hovering anywhere on the line.
  • betterGitLineBlame.statusBarItemPriority (default: 500)
    • Priority of the status bar item. Items are ordered from highest to lowest priority, left to right.
  • betterGitLineBlame.ignoreWhitespaceChanges (default: true)
    • Ignore whitespace changes when blaming lines, i.e. pass the -w flag to git blame.
  • betterGitLineBlame.reblameOnSave (default: false)
    • Run the "Reblame File" command automatically on save.
  • betterGitLineBlame.maxSummaryLength (default: 50)
    • Maximum length of commit message summaries in line annotations. Summaries longer than this will be truncated with an ellipsis. Set to 0 for no limit.
  • workbench.colorCustomizations > betterGitLineBlame.foregroundColor
    • Foreground color of the inline blame annotations.

FAQ

Do I need to reblame?

Only if you're seeing "Uncommited changes" on lines with no diff.

The extension keeps track of local edits, and reblames on git HEAD changes, so you don't normally need to run the "Reblame File" command or use the betterGitLineBlame.reblameOnSave configuration. However, if you change a line and then later undo it, the annotation will still be "Uncomitted changes". If you want to see the original commit, you need to reblame.

Why do annotations flicker when I delete or join lines?

By default, the extension attaches annotations to the end of the line. When you use VS Code's "Delete Line" or "Join Lines" commands, the annotation might briefly appear in the middle of a line, shifting the rest of the line to the right, before correcting itself. This is usually more noticeable when using Remote Development.

If this bothers you, you can enable the betterGitLineBlame.annotateWholeLine configuration property. This makes the annotations use isWholeLine: true, ensuring they never appear in the middle of a line. The downside is that commit information will show when you hover anywhere on the line, not just when you hover on the blame annotation. In particular, it will get combined with hover messages provided by other extensions, such as type information and documentation.

Alternatives

The alternative I'm competing with is GitLens. I find it too bloated, and dislike how it pushes paid features.

Someone else had the exact same idea with carlthome/vscode-git-line-blame. However, as of March 2024, that extension is much simpler: it spawns a git process every time the text cursor moves.

License

© 2024 Mitchell Kember

VS Code Git Line Blame is available under the MIT License; see LICENSE for details.

Issues· 9 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言