The git shortlog
command provides a summary of the Git log. It is particularly helpful if you are only interested in a short summary. The command groups commits by author, making it easy to see who worked on what.
Initial Example
$ git shortlog
SHORTLOG Options
Option | Description |
---|---|
-n | Limits the number of commit lines to be displayed per author. |
-s , --summary | Displays only a summary of commit counts per author, without individual commit messages. |
--numbered | Equivalent to -n , limits the number of commit lines per author. |
--all | Includes all commits from all branches. |
--no-merges | Omits merge commits from the output. |
--author | Filters commits by a specific author. Example: --author="Author Name" . |
<since> ..<until> | Displays commits within a specific range. Example: v1.0.0..v2.0.0 . |
Examples
1. Basic Shortlog
Shows a summary of commits grouped by author.
$ git shortlog
2. Shortlog with a Specific Number of Lines per Commit
Limits the number of commit lines to be displayed.
$ git shortlog -n
3. Shortlog with Sorting by Number of Commits
Sorts the output by the number of commits per author.
$ git shortlog -n -s
4. Shortlog with Commits Filtered by a Specific Author
Shows only the commits by a specific author.
$ git shortlog --author="Author Name"
5. Shortlog with a Specific Commit Range
Displays commits within a specific range.
$ git shortlog <since>..<until>
Replace <since>
and <until>
with the desired commit range.