| 输出 | 提交哈希(每行一个) |
|---|---|
| --count | 只输出数量 |
| 区间 | 与 git log 相同的 A..B 语法 |
常用示例
常用示例
git rev-list --count HEAD
git rev-list --count main..feature
git rev-list --all --count
git rev-list HEAD --not main | head评审前统计「分支带来多少提交」用 rev-list --count main..feature 一条搞定。
输出可达提交的哈希列表:--count 计数、--all 覆盖全部引用、区间语法与 log 一致,是统计脚本的基础。
| 输出 | 提交哈希(每行一个) |
|---|---|
| --count | 只输出数量 |
| 区间 | 与 git log 相同的 A..B 语法 |
git rev-list --count HEAD
git rev-list --count main..feature
git rev-list --all --count
git rev-list HEAD --not main | head