Which Git commit stats are easy to pull

前端 未结 13 1799
面向向阳花
面向向阳花 2020-12-12 11:23

Previously I have enjoyed TortoiseSvn\'s ability to generate simple commit stats for a given SVN repository. I wonder what is available in Git and am particularly interested

13条回答
  •  时光取名叫无心
    2020-12-12 11:58

    Here are ways to get stats for a specific branch or two hashs.

    key here is the ability to do HASH..HASH

    Below I am using the first hash from a branch to the HEAD which is the end of that branch.

    Show total commits in a branch

    • git log FIRST_HASH..HEAD --pretty=oneline | wc -l
    • Output 53

    Show total commits per author

    • git shortlog FIRST_HASH..HEAD -sne
    • Output
    • 24 Author Name
    • 9 Author Name

提交回复
热议问题