获取特定作者(不止一个)所做的提交
Get the commits made by specific authors (more than one)
如果我想获得 Alice
的提交,我使用 git log --author 'Alice'
。但是,如果我也想在其中包含 Bob
的提交怎么办?
我尝试了以下方法:
git log --author 'Alice|Bob'
git log --author 'Alice,Bob'
多次尝试使用相同的参数:
git log --author 'alice' --author 'bob'
编辑:
如果 Git 使用正确的标志 (USE_LIBPCRE) 编译,您可以传递选项 --perl-regexp
,以便搜索模式被解释为正则表达式:
git log --perl-regexp --author 'alice|bob'
...发现更多:
Git 将选项中的所有模式解释为正则表达式。只有当你想使用 Perl 兼容的正则表达式时,你才需要选项 --perl-regexp
。
但是如果你想使用普通的正则表达式,你必须转义 "or":
git log --author 'alice\|bob'
如果我想获得 Alice
的提交,我使用 git log --author 'Alice'
。但是,如果我也想在其中包含 Bob
的提交怎么办?
我尝试了以下方法:
git log --author 'Alice|Bob'
git log --author 'Alice,Bob'
多次尝试使用相同的参数:
git log --author 'alice' --author 'bob'
编辑:
如果 Git 使用正确的标志 (USE_LIBPCRE) 编译,您可以传递选项 --perl-regexp
,以便搜索模式被解释为正则表达式:
git log --perl-regexp --author 'alice|bob'
...发现更多:
Git 将选项中的所有模式解释为正则表达式。只有当你想使用 Perl 兼容的正则表达式时,你才需要选项 --perl-regexp
。
但是如果你想使用普通的正则表达式,你必须转义 "or":
git log --author 'alice\|bob'