How can I find the number of commits between two commitishes in git
?
Additionally, is there some way that I could do the same with any project on GitHub
$ git log 375a1..58b20 --pretty=oneline | wc -l
Specify your start commit followed by your end commit, and then count the lines. That should be the count of commits between those two commit ranges. Use the --pretty=oneline
formatting so that each commit takes up a single line.
Note that using two dots (375a1..58b20
) is different than using three dots (375a1...58b20
); see What are the differences between double-dot “..” and triple-dot “…” in Git commit ranges? for more information about this and to figure out which one you want to use.
As for the GUI in GitHub, I don't know of a way to accomplish this same task. But that should be trivial, as the above is the possible way to do it directly using Git and Bash.