File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -690,6 +690,25 @@ may be any path to a file tracked by git.
690690Examples
691691--------
692692
693+ [[counting-commits-on-a-branch]]
694+ Counting the number of commits on a branch
695+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696+
697+ Suppose you want to know how many commits you've made on "mybranch"
698+ since it diverged from "origin":
699+
700+ -------------------------------------------------
701+ $ git log --pretty=oneline origin..mybranch | wc -l
702+ -------------------------------------------------
703+
704+ Alternatively, you may often see this sort of thing done with the
705+ lower-level command gitlink:git-rev-list[1], which just lists the SHA1's
706+ of all the given commits:
707+
708+ -------------------------------------------------
709+ $ git rev-list origin..mybranch | wc -l
710+ -------------------------------------------------
711+
693712[[checking-for-equal-branches]]
694713Check whether two branches point at the same history
695714~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments