3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

git log で月ごとのリリース回数を数える

Last updated at Posted at 2019-05-23

前提条件

  • リリースごとに何らかのルールで git tag 打ってる
    • ここでは release/v1.0.0 みたいなタグを打ってることにする

コマンド

git log --all --pretty='%ad %d' --date=format:%G-%m |
grep "tag: release/v"|
cut -d " " -f 1|
awk '{arry[$NF] += 1;} END{for(i in arry){print i "," arry[i]}}'|
sort
2019-04,5
2019-05,2

こんな感じの出力が得られます

解説

  • git log --pretty='%ad %d' --date=format:%G-%m
    • 2019-05 (tag: release/v2.100.0) こんな出力得るためのフォーマット整え
  • grep
    • 特定のタグ名だけにする
  • cut
    • 2019-05 の部分だけにする
  • awk
    • 月ごとにカウント
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?