Git History Diff

背景:

开发中一定要 review 自己的代码再提交, 因为没有 review 的代码和闭着眼睛写的没什么区别

如果是小改动我们可以 review 单个 commit, 如果一个完整的功能设计到多个 commit 建议是拉分支然后 review 分支的不同

2 个工具:

  • git diff 命令行, 直接对比 2 个 commit, 不同分支也可以直接使用
  • vscode 插件 Git History Diff 可视化对比

安装 Git History Diff

插件市场下载安装 Git History Diff

使用

F1 打开命令面板

  • GitHD: View History: 常用, 比较 commit
  • GitHD: View Branch History: 常用, 比较不同分支多个 commit
  • GitHD: View File History: 单个文件
  • GitHD: View Line History: 单行
  • GitHD: View Entire History: 整个对比
  • GitHD: View Stashes: 常用 stash 的记录
  • GitHD: View Branch Diff: 常用, 比较不同分支多个 commit
  • GitHD: View Un-committed File Diff: 没有提交的和未提交的文件的对比
  • GitHD: Input Ref: 输入的 Ref

reference

官方文档

https://github.com/huizhougit/githd

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐