Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the commits made by specific authors (more than one)

Tags:

git

commit

If I want to get Alice's commits I use git log --author 'Alice'. But what if I want to include there Bob's commits as well?

I tried the following:

git log --author 'Alice|Bob'
git log --author 'Alice,Bob'
like image 394
Ionică Bizău Avatar asked Sep 14 '15 14:09

Ionică Bizău


People also ask

What is the git command to view all the commits made by a specific person?

The git log command displays all of the commits in a repository's history.

How do you get all commits in a pull request?

You can list the pull requests associated with a commit using GET /repos/:owner/:repo/commits/:commit_sha/pulls , which will show the pull requests which the given commit is associated with. This does mean that you'll need to check every commit to see if its associated with the PR.


1 Answers

Try it with the same argument multiple times:

git log --author 'alice' --author 'bob'

edit: If Git is compiled with the right flags (USE_LIBPCRE) you can pass the option --perl-regexp so the pattern for search is interpreted as a regular expression:

git log --perl-regexp --author 'alice|bob' 

...Found more: Git interprets all patterns in the options as regex. Only if you want to use Perl compatible regex you need the option --perl-regexp. But if you want to use normal regex, you have to escape the "or":

git log --author 'alice\|bob' 
like image 186
Alu Avatar answered Oct 09 '22 00:10

Alu