惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
D
Docker
B
Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
G
Google Developers Blog
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42

博客园 - 凌度

unity加密方案 [C#]AES加解密 vs20109自动补全unity 机器学习 爬取tieba的APP点赞等数据 爬取douyin 数据仓库和数据湖 通过mitmproxy爬取APP的数据 linux下检查网络连通情况 linux下使用clamav排查病毒 [linux]测硬盘读写速度、内存读写速度 QPS/TPS的预估 tornado多进程模式不同进程写不同日志 [python]pypy优化python性能 [linux]查看进程占用内存 [linux]杀死同一个应用的所有进程 [LINUX] 快速回收连接 jdbc批量写入 Python执行时间的计算方法
GIT统计代码行数
凌度 · 2019-11-14 · via 博客园 - 凌度

1、使用git log

cd /data/gitlab/gitlab/repositories/dataanalysis/
cd doc-center.git
git log --since ==2019-01-01 --until=2019-01-01 | wc -l

git log --author=yourname --since="2019-01-01" --no-merges | grep -e 'commit [a-zA-Z0-9]*' | wc -l
git log --since="2019-01-01" --no-merges | grep -e 'commit [a-zA-Z0-9]*' | wc -l

git log | grep "^Author: " | awk '{print $2}' | sort | uniq -c | sort -k1,1nr


git log --author="用户名" --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 }' -

2、使用gitstats

gitstats /data/gitlab/gitlab/repositories/dataanalysis/doc-center.git /data/git_stat_html/doc-center

这个生成html统计页面,很方便看。还有个类似的产品是git_stats

提交次数git shortlog --numbered --summary
查看所有的commit数git log --oneline | wc -l
提交删除行数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 }'
使用cloc统计代码行数给力: