获取特定作者的提交(不止一个)

Ion*_*zău 5 git commit

如果我想得到Alice提交,我会使用git log --author 'Alice'.但是,如果我想包括那些Bob提交怎么办?

我尝试了以下方法:

git log --author 'Alice|Bob'
git log --author 'Alice,Bob'
Run Code Online (Sandbox Code Playgroud)

Alu*_*Alu 5

多次使用相同的参数尝试:

git log --author 'alice' --author 'bob'
Run Code Online (Sandbox Code Playgroud)

编辑:如果使用正确的标志(USE_LIBPCRE)编译Git,您可以传递选项,--perl-regexp以便将搜索模式解释为正则表达式:

git log --perl-regexp --author 'alice|bob' 
Run Code Online (Sandbox Code Playgroud)

...发现更多:Git将选项中的所有模式解释为正则表达式.只有当您想要使用Perl兼容的正则表达式时,您才需要该选项--perl-regexp.但是如果你想使用普通的正则表达式,你必须逃避"或":

git log --author 'alice\|bob' 
Run Code Online (Sandbox Code Playgroud)