我知道的一种愚蠢的方式是:
git diff commit-number1 commit-number2
Run Code Online (Sandbox Code Playgroud)
有更好的方法吗?
我的意思是我想知道commit1本身,我不想在它之前添加commit2作为参数.
Geo*_*ale 47
git show <commit>
要显示提交对统计信息的作用:
git show <commit> --stat
Run Code Online (Sandbox Code Playgroud)
要显示提交日志,并为范围中的每个提交引入差异:
git log -p <commit1> <commit2>
Run Code Online (Sandbox Code Playgroud)
<commit>
?每个提交都有一个我们在这里引用的唯一ID <commit>
.唯一ID是SHA-1哈希 - 您正在存储的内容的校验和加上标题.#TMI
如果你不了解你的<commit>
:
git log
要查看提交历史
找到你关心的提交.
这是我所知道的一种方式.有了git
,似乎总有不止一种方法可以做到这一点.
git log -p commit1 commit2
Run Code Online (Sandbox Code Playgroud)