zoukankan      html  css  js  c++  java
  • git代码统计

    统计某人的代码提交量,包括增加,删除:
    git log --author="$(git config --get user.name)" --pretty=tformat: --numstat | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s ",add,subs,loc }' -

    7个月写了30398行代码    竟然有这么多

    统计每个人的增删行数

    git log --format='%aN' | sort -u | while read name; do echo -en "$name "; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s ", add, subs, loc }' -; done

    查看仓库提交者排名前 5

    git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5 

    贡献者统计  提交过代码的人数

    git log --pretty='%aN' | sort -u | wc -l 

    提交数统计:

    git log --oneline | wc -l

  • 相关阅读:
    python基本数据类型(—)
    linux基本命令
    1、认识Mysql
    Flask-SQLAlchemy详解
    sqlalchemy基本增删改查
    pymongo方法详解
    uWSGI+Nginx部署
    uwsgi
    nginx负载均衡配置
    redis-sentinel主从复制高可用(哨兵)
  • 原文地址:https://www.cnblogs.com/xxj0316/p/9412074.html
Copyright © 2011-2022 走看看