跳转至

Compare diff recent two commits

本文总阅读量次 ,原创教程,严禁转载

Git 比较提交差异

Git 使用命令行,比较最近两次提交差异的代码。

使用 diff 命令,基本格式:

git diff commit_id1 commit_id2 [filename]

举例:

1)比较最近2次提交差异:

git diff head^ head 
其中head^指向当前分支head的上一次提交

2)比较最近2次提交文件filename1的差异:

git diff head^ head  filename1