Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Git Line Diff HistoryNew to Visual Studio Code? Get it now.
Git Line Diff History

Git Line Diff History

Git Line Diff History

|
5 installs
| (1) | Free
在 VS Code 中选中任意行即可查看对应的 Git 历史,支持跨重命名追踪、合并提交补丁及上下文折叠/展开
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Git Line History

查看任意选中行的 Git 历史,并在 VS Code 内直接比对改动。扩展会自动沿着重命名与移动追踪代码,同时在合并提交中提取真实补丁。

Features

  • 右键选中的代码行并选择 Git: View Line History,即可得到对应的提交列表
  • 自动结合 git log --follow、行级 git blame 与合并提交解析,避免遗漏最近的改动
  • 提供统一视图与左右分栏 Diff,点选列表即可即时切换
  • 支持折叠/展开未改动的上下文,快速在精简视图与完整补丁之间切换
  • 对大文件做了裁剪优化,同时保留查看完整补丁的选项

Usage

  1. Open a file that is tracked in a Git repository
  2. Select one or more lines of code
  3. Right-click and select "Git: View Line History" from the context menu
  4. Git 历史会显示在右侧面板,你可以切换 Diff 展示方式或展开上下文
  5. 点击“显示未变动”即可加载完整补丁,再次点击则折叠回精简视图

Requirements

  • Git must be installed and available in your system PATH
  • The file must be part of a Git repository

Supported Languages

This extension works with any file type that is tracked in Git, including:

  • JavaScript/TypeScript
  • Python
  • Java
  • C/C++
  • C#
  • PHP
  • Go
  • Rust
  • And many more!

License

MIT

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