118
99

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 5 years have passed since last update.

そのgitリポジトリで自分の書いたコードの行数を数える。

Posted at

大人の事情で自分の書いたコード行数を対外的に説明しないといけないときがあったりします。
そんなときはこれ

git ls-files | xargs -n1 git --no-pager blame -f -w|grep 自分のgitユーザ名 |wc -l

git ls-filesでリポジトリ管理下のファイル名一覧を獲得し

git --no-pager blameで全部の行の作者を行単位で吐き出し

grepで自分が作者になってる行を洗い出して

wc -lでカウントします。

簡単ですね。

118
99
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
118
99

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?