git - 在 git 中记录前 10 个

标签 git logging

两个问题:

  1. 如何在 git 中从头到尾显示前 10 次提交。 (无分支机构)
  2. 如何指定提交索引并记录它。 (显示第二个或第三个)

我知道 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/

相关文章:

security - 使 gitosis-admin git 存储库安全

带条件检查的 git 别名

c++ - 为 C++ 配置 google glog 和 gflags

android - 是否可以在 RushORM 中记录所有内部 SQL 查询?

git - 是否可以通过试运行来 git stash pop?

git - 悬空的 Twig ?

java - Log4j2 使用 {} 反对使用 %d 或 %s

logging - 在 Jenkins 作业中使用时,Groovy 记录器不工作

java - 缺少记录参数 Sonar 规则

Git Copssh 不再免费,有哪些替代方案,以及如何在 Windows 上设置本地 Git 服务器