Is it possible to list all users that contributed to a project (users that have done commits) in Git?
Any additional statistics?
The answer is "/users/:user/repo", but I have all the code that does this in an open-source project that you can use to stand up a web-application on a server.
The git shortlog command is a special version of git log intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who's been working on what.
You can inspect a Git repository by using the git status command. This command allows you to see which changes have been staged, which haven't, and which files aren't being tracked by Git. You should try and remember that status output does not show you any information regarding the committed project history.
The git log command shows a list of all the commits made to a repository. You can see the hash of each Git commit, the message associated with each commit, and more metadata. This command is useful for displaying the history of a repository.
To show all users & emails, and the number of commits in the CURRENT branch:
git shortlog --summary --numbered --email
Or simply:
git shortlog -sne
To show users from all branches (not only the ones in the current branch) you have to add --all
flag:
git shortlog -sne --all
If you want to be more specific in the list (find a list of unique committer and author), you could use git log
:
git log --pretty="%an %ae%n%cn %ce" | sort | uniq
%an
author name%ae
author email%n
new line%cn
committer name%ce
committer emailOther placeholders are described in the pretty print documentation of git log
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With