How can I calculate the number of lines changed be

2020-01-25 03:13发布

Is there any easy way to calculate the number of lines changed between two commits in git? I know I can do a git diff, and count the lines, but this seems tedious. I'd also like to know how I can do this, including only my own commits in the linecounts.

标签: git
8条回答
贪生不怕死
2楼-- · 2020-01-25 03:34

Assuming that you want to compare all of your commits between abcd123 (the first commit) and wxyz789 (the last commit), inclusive:

git log wxyz789^..abcd123 --oneline --shortstat --author="Mike Surname"

This gives succinct output like:

abcd123 Made things better
 3 files changed, 14 insertions(+), 159 deletions(-)
wxyz789 Made things more betterer
 26 files changed, 53 insertions(+), 58 deletions(-)
查看更多
霸刀☆藐视天下
3楼-- · 2020-01-25 03:37

git log --numstat just gives you only the numbers

查看更多
登录 后发表回答