Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git统计代码行数 #19

Open
congjiye opened this issue Mar 30, 2021 · 0 comments
Open

git统计代码行数 #19

congjiye opened this issue Mar 30, 2021 · 0 comments
Labels
随笔 随笔

Comments

@congjiye
Copy link
Owner

congjiye commented Mar 30, 2021

全部统计

git log --author="$(git config --get user.name)" --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -

输出

added lines: 31272 removed lines : 2680 total lines: 28592

统计部分(排除某些文件夹)

git log --author="$(git config --get user.name)" --pretty=tformat: --numstat -- . ":(exclude)src" | awk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -

输出

added lines: 7225 removed lines : 160 total lines: 7065
@congjiye congjiye added the 随笔 随笔 label Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
随笔 随笔
Projects
None yet
Development

No branches or pull requests

1 participant