【git命令】git diff
git diff
1. 显示暂存区和工作区的差异:
git diff [file]
2. 显示暂存区和上一次提交(commit)的差异:
git diff --cached [file]
# 或者用下面的命令
git diff --staged [file]
3. 显示两次 commit 提交之间的差异:
$ git diff [first-branch]...[second-branch]
例如:
git diff 9f38a28ebd94f3ab833c25c0645ceb24a090c260 6bf732d0fc7bed24b42dd4290373e39b802500ff