1. 程式人生 > >git log --author詳解,這個是個模糊匹配

git log --author詳解,這個是個模糊匹配

方式 檢索 工作流 字符 如果 模糊 tip 表達式 模糊匹配

git log --author=authorname

--author=<pattern>, commits whose author matches any of the given patterns are chosen (similarly for multiple --committer=<pattern>).

它接受正則表達式,返回所有作者名字滿足這個規則的提交。如果你知道那個作者的確切名字你可以直接傳入文本字符串:

git log --author="John"

它會顯示所有作者叫John的提交。作者名不一定是全匹配,只要包含那個子串就會匹配。

你也可以用正則表達式來創建更復雜的檢索。比如,下面這個命令檢索名叫Mary或John的作者的提交。

git log --author="John\|Mary"

註意作者的郵箱地址也算作是作者的名字,所以你也可以用這個選項來按郵箱檢索。

如果你的工作流區分提交者和作者,--committer也能以相同的方式使用。

git log --author詳解,這個是個模糊匹配