1
0
mirror of https://github.com/namibia/tips.git synced 2024-11-05 21:07:53 +00:00

count commits in a branch (#122)

This commit is contained in:
S N Munendra 2016-08-14 20:36:13 +05:30 committed by hemanth.hm
parent d155ea094e
commit 81040e9500
2 changed files with 9 additions and 0 deletions

View File

@ -136,6 +136,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [Group commits by authors and title](#group-commits-by-authors-and-title)
* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work)
* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute)
* [Number of commits in a branch](#number-of-commits-in-a-branch)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -930,5 +931,10 @@ git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add +=
", add, subs, loc }' - # on Mac OSX
```
## Number of commits in a branch
```sh
git rev-list --count <branch-name>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -397,4 +397,7 @@
"title": "Show how many lines does an author contribute",
"tip": "git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -",
"alternatives": ["git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX"]
},{
"title": "Number of commits in a branch",
"tip": "git rev-list --count <branch-name>"
}]