summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e2163e)
raw | patch | inline | side by side (parent: 9e2163e)
author | J. Bruce Fields <bfields@citi.umich.edu> | |
Sun, 13 May 2007 06:14:45 +0000 (02:14 -0400) | ||
committer | J. Bruce Fields <bfields@citi.umich.edu> | |
Fri, 18 May 2007 01:58:51 +0000 (21:58 -0400) |
This is partly just an excuse to mention --pretty= and rev-list.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Documentation/user-manual.txt | patch | blob | history |
index 9cc5fc9db3b3c8be33b6d13e281fc85a72a9c866..242f5aa479620e087d70a1154c86cc142f9e9c43 100644 (file)
Examples
--------
+[[counting-commits-on-a-branch]]
+Counting the number of commits on a branch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Suppose you want to know how many commits you've made on "mybranch"
+since it diverged from "origin":
+
+-------------------------------------------------
+$ git log --pretty=oneline origin..mybranch | wc -l
+-------------------------------------------------
+
+Alternatively, you may often see this sort of thing done with the
+lower-level command gitlink:git-rev-list[1], which just lists the SHA1's
+of all the given commits:
+
+-------------------------------------------------
+$ git rev-list origin..mybranch | wc -l
+-------------------------------------------------
+
[[checking-for-equal-branches]]
Check whether two branches point at the same history
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~