Skip to content

Instantly share code, notes, and snippets.

@suzukiplan
Created August 27, 2016 16:07
Show Gist options
  • Save suzukiplan/a7729b7a7dca3ee30824590ef192bc2b to your computer and use it in GitHub Desktop.
Save suzukiplan/a7729b7a7dca3ee30824590ef192bc2b to your computer and use it in GitHub Desktop.
git で commitした回数, 追加した行数, 削除した行数 を 表示するシェル
#!/bin/sh
echo commits: `git log --since=1971-01-01 --until=2035-12-31 --oneline --no-merges | wc -l`
echo added: `git log --since=1971-01-01 --until=2035-12-31 --oneline --numstat --no-merges --pretty=format:"" | cut -f1 | awk 'BEGIN {sum=0} {sum+=$1} END {print sum}'`
echo deleted: `git log --since=1971-01-01 --until=2035-12-31 --oneline --numstat --no-merges --pretty=format:"" | cut -f2 | awk 'BEGIN {sum=0} {sum+=$1} END {print sum}'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment