Find The Number Of Commits In A Git Repository

Use the following command to find out how many commits there have been in a git repository. Not really useful in itself, but an interesting figure to see how active a project has been over it's lifetime.

git log --oneline --all | wc -l

The following git log flags are in use here:

--oneline - Removes some of the information from the log entries and displays each on a single line.

--all - Shows all commits across all branches.

The -l (lower case L) flag is supplied to the wc command so that it counts the number of lines in the given input.

Add new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
8 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.