两个问题:
- 如何在 git 中从头到尾显示前 10 次提交。 (无分支机构)
- 如何指定提交索引并记录它。 (显示第二个或第三个)
我知道 git 使用 parent 链接提交,很容易从头到尾记录提交。
像:git log HEAD~10
但是我需要从头到尾查询,可以吗?
最佳答案
git log -10
将显示与修订规范匹配的 10 个最新提交(缺少规范意味着“所有提交”)。
参见联机帮助页:
git help log
部分提交限制
-<number>, -n <number>, --max-count=<number>
Limit the number of commits to output.
关于git - 在 git 中记录前 10 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10345182/