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

推荐订阅源

The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LangChain Blog
WordPress大学
WordPress大学
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
P
Proofpoint News Feed
D
DataBreaches.Net

博客园 - 凌度

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统计代码行数给力: