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
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