用 git shortlog 统计贡献者

按作者统计提交数,用于发布说明或报告。

macOS统计Git命令行低风险
运行 git shortlog -sn --all,按提交数列出作者。

01命令

命令
$ git shortlog -sn --all

02作用说明

shortlog 按作者分组,可输出计数或完整标题,适合撰写发布说明或致谢贡献者。与标签范围配合,正好汇总某个版本。

03风险

风险低风险
使用条件Git 2.20+ (install with Homebrew or Xcode Command Line Tools)
系统兼容性macOS with Git installed (Homebrew or Xcode Command Line Tools)
!注意: 作者身份取决于本地 git 配置,同一人可能以多个姓名或邮箱出现。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • git-shortlog documentation
    Git · vendor-doc · 2026-09-20
    依据: Documents git shortlog, including -s summary and -n numeric sort.

最后验证: 2026-10-13 · 分类: 开发者