Skip to content

Instantly share code, notes, and snippets.

@edwardean
Created June 6, 2018 05:13
Show Gist options
  • Save edwardean/2300714e631621985e1077330e4bbf0f to your computer and use it in GitHub Desktop.
Save edwardean/2300714e631621985e1077330e4bbf0f to your computer and use it in GitHub Desktop.
统计Git修改记录
  • 统计从指定日期到现在提交的代码行数,并且排除Pods目录的更改:
git log --author="$(git config --get user.name)" --since='2018-01-01' --pretty=tformat: --numstat ":(exclude)Pods" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
  • 统计从指定日期到现在的提交次数:
git log --author="$(git config --get user.name)" --since='2018-01-01' --no-merges --oneline | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment