git shortlog
git
Usage
git shortlog -sne [<revision-range>]Groups commits by author and counts them, handy for release notes; one person with two email addresses counts twice unless a .mailmap merges them.
Common flags
| Flag | Meaning |
|---|---|
| -s | counts only, no subjects |
| -n | sort by number of commits |
| -e | show the email address as well |
| -c | group by committer instead of author |
| --no-merges | leave merge commits out of the count |
| --since=<date> | only commits after a date |
Examples
git shortlog -sneevery contributor with a commit count
git shortlog -sn v1.1.0..v1.2.0who did what between two releases
git shortlog --no-merges -sn --since="1 year ago"this year, merges excluded
The confusion is that undo has several shapes — moving where a branch points is not the same as adding a commit that reverses it.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does git shortlog do?
Groups commits by author and counts them, handy for release notes; one person with two email addresses counts twice unless a .mailmap merges them.
Q. How do I type it?
git shortlog -sne [<revision-range>] — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
6 are listed here; the full set is in man git. This command sits under git.
Related commands
man page: man git-shortlog