Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print a list of all commiters since branch creation

Tags:

git

I am looking to print a single list of all users that committed on a branch since it was created from the master (or even as far back as master creation)

I've looked at git log and I don't see such an option.

Even if I was to use git log, I just want to print an entire list without having to tab through it so that I can output it to a file.

What is the best way to achieve this?

Thanks

like image 531
DJ180 Avatar asked Jun 04 '14 13:06

DJ180


1 Answers

To show a list of all committers you can use this command

$ git shortlog -sn

Output will be similar to

42  DJ180
1   Tim Castelijns

Naturally this first lists the number of commits and then the person who committed. In this case I made 1 commit and you made 42


To list only the committers of the commits in the current master branch:

$ git shortlog -sn master

To list only the committers of the branch branchname since it branched off of master:

$ git shortlog -sn master..branchname

This one makes use of the so called revision range:

<revision range>

Show only commits in the specified revision range. When no is specified, it defaults to HEAD (i.e. the whole history leading to the current commit). origin..HEAD specifies all the commits reachable from the current commit (i.e. HEAD), but not from origin.


More info at http://git-scm.com/docs/git-shortlog

That shows you can for example add a -e parameter to include the email addresses of the committers.

like image 195
Tim Avatar answered Oct 19 '22 22:10

Tim