なんだかGoodVibes

日々の勉強メモです。

【Git】shortlogでコミット数を取得する

こんにちは。
本日はgitコマンドメモです。


shortlogコマンド

git shortlogコマンドは、コミットの統計を取得してくれます。

$ git shortlog

Kevin (1):
      Initial commit

Bob (2):
      add sample
      add init sample

コミット数が多いユーザー順にしたい場合は-nオプションを付けます。

$ git shortlog -n

Bob (2):
      add sample
      add init sample

Kevin (1):
      Initial commit

コミット数のみを取得したい場合は、-sオプションを付けます。

$ git shortlog -s

1  Kevin
2  Bob

期間を指定する場合は、--since--untilを指定します。

$ git shortlog -s --since="2023/04/01" --until="2023/04/30"

1  Bob



以上です。