Last active
April 28, 2017 07:52
-
-
Save xhlwill/f73e6dd33a7f8c2fbf70 to your computer and use it in GitHub Desktop.
count total commits on current branch - 统计当前分支的提交数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log | grep -e 'commit [a-zA-Z0-9]*' | wc -l | |
# 不准确,如果提交信息里有commit ...字样也会计算进去 | |
# UPDATE: | |
git log --oneline | wc -l | |
# UPDATE 2: | |
# get the commit count for a revision (HEAD, master, a commit hash) | |
git rev-list --count <revision> | |
# get the commit count across all branches | |
git rev-list --all --count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/677436/how-to-get-the-git-commit-count