简体   繁体   中英

How can I summarize the changes users have made in git?

Is there one command that I can use to summarize all the changes (ie, number of commits, number of insertions and deletions) users have made in a repo? I have used git shortlog --no-merges -sn to see the number of commits but I'd like to include the number of insertions and deletions as well. I do not want to specify a specific author to be summarized.

UPDATE: The reason I don't want to specify authors is that I want to be able to run a script on multiple repos without any intervention.

Your need is what like these Number of commits https://github.com/tj/git-extras/blob/master/Commands.md#git-count

Number of insertions and deletions (blame) https://github.com/tj/git-extras/blob/master/Commands.md#git-guilt

or

git log --shortstat | \
awk '/^ [0-9]/ { f += $1; i += $4; d += $6 } \
END { printf("%d files changed, %d insertions(+), %d deletions(-)", f, i, d) }'

For example, at https://github.com/spring-projects/spring-boot/

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM