git shortlog

git

書き方

git shortlog -sne [<revision-range>]

コミットを人ごとにまとめて数えます。同じ人がメールアドレスを二つ使っていると、.mailmapでまとめない限り二人として数えられます。

よく使うオプション

オプション意味
-scounts only, no subjects
-nsort by number of commits
-eshow the email address as well
-cgroup by committer instead of author
--no-mergesleave merge commits out of the count
--since=<date>only commits after a date

git shortlog -sne

every contributor with a commit count

git shortlog -sn v1.1.0..v1.2.0

who did what between two releases

git shortlog --no-merges -sn --since="1 year ago"

this year, merges excluded

取り消しに何通りもあるのが混乱のもとです — ブランチの指す先を動かすのと、打ち消すコミットを積むのは別です。

読み方

  • 角括弧 [ ] は省いてよい部分です。
  • 三点 … は複数並べられるという意味です。
  • オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。

よくある質問

Q. git shortlog は何をしますか。

コミットを人ごとにまとめて数えます。同じ人がメールアドレスを二つ使っていると、.mailmapでまとめない限り二人として数えられます。

Q. どう打ちますか。

git shortlog -sne [<revision-range>] — 角括弧は省いてよい部分です。

Q. よく使うオプションはいくつですか。

ここにまとめたのは6個です。全部は man git にあります。このコマンドはgitの仲間です。

関連するコマンド

man ページ: man git-shortlog