LoginSignup
11
6

More than 5 years have passed since last update.

Gitのコミット数と行数を確認する

Posted at

Gitで自分のコミット数を計測したいときありますよね。
そんなときに使ったコマンドを残しておきます。
私のGitのアカウントは、noracornなのでそこは読み替えてください。

全体のコミット数を確認するコマンド

リポジトリ内に移動して打ってください。

git log --date=iso --pretty=format:"[%ad] %h %an : %s" | grep  "noracorn :" | wc -l

月ごとのコミットを見るコマンド

git log --date=iso --pretty=format:"[%ad] %h %an : %s" | grep  "noracorn :" | grep 2019-01 | wc -l

修正した行数を見るコマンド(合計行数、追加行数、削除行数)

git log --numstat --pretty="%H" --author='noracorn' --since=2013-01-11 --until=2019-01-01 --no-merges | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("%d (+%d, -%d)\n", plus+minus, plus, minus)}'
11
6
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
11
6