【问题标题】:How can I calculate the number of lines added and modified from First commit(initial commit) to Last commit in git?如何计算从第一次提交(初始提交)到最后一次提交在 git 中添加和修改的行数?
【发布时间】:2019-04-19 14:25:39
【问题描述】:

如何计算从 First 添加和修改的行数 commit(initial commit) to Last commit in git?

【问题讨论】:

标签: git github


【解决方案1】:

可以使用以下任一命令,统计信息将相同

1) 显示更改文件计数、插入计数和删除计数的统计信息

git diff $(git log --pretty=format:"%h" | tail -1) --shortstat

2) 只显示改变的和新增的行数,不考虑删除的行数

git diff $(git log --pretty=format:"%h" | tail -1) | grep '^+' | grep -v +++ | wc -l

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-01
    • 1970-01-01
    • 2016-11-25
    • 1970-01-01
    • 1970-01-01
    • 2021-04-27
    • 2014-08-02
    • 2011-01-21
    相关资源
    最近更新 更多