Skip to content

Commit 81040e9

Browse files
munendrasnhemanth
authored andcommitted
count commits in a branch (#122)
1 parent d155ea0 commit 81040e9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
136136
* [Group commits by authors and title](#group-commits-by-authors-and-title)
137137
* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work)
138138
* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute)
139+
* [Number of commits in a branch](#number-of-commits-in-a-branch)
139140

140141
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
141142
<!-- @doxie.inject end toc -->
@@ -930,5 +931,10 @@ git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add +=
930931
", add, subs, loc }' - # on Mac OSX
931932
```
932933

934+
## Number of commits in a branch
935+
```sh
936+
git rev-list --count <branch-name>
937+
```
938+
933939
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
934940
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,7 @@
397397
"title": "Show how many lines does an author contribute",
398398
"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 }' -",
399399
"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"]
400+
},{
401+
"title": "Number of commits in a branch",
402+
"tip": "git rev-list --count <branch-name>"
400403
}]

0 commit comments

Comments
 (0)