简体   繁体   English

git log正则表达式搜索

[英]git log regex search

I just found out the differences between git log --all -G "mystring" and, git log --all -S "mystring" as you can see here , for example. 我刚刚发现了git log --all -G "mystring"git log --all -S "mystring"之间的区别,例如,您在这里可以看到。

But, I'd like to know if I can specify several regular expressions (aka regex) to -G , with something like: git log --all -G "str1" --and -G "str2" 但是,我想知道是否可以为-G指定几个正则表达式(aka regex),例如: git log --all -G "str1" --and -G "str2"

Of course, I can always wrap git commands inside python or bash scripts, but I'd like to know if using pure-git-commands, I can do this. 当然,我总是可以将git命令包装在python或bash脚本中,但是我想知道是否使用pure-git-commands可以做到这一点。

Thanks very much!! 非常感谢!!

To search the commit log (across all branches) for the given text: 要在提交日志中(跨所有分支)搜索给定的文本:

git log --all --grep='String'

so 所以

git log --grep=str1 --grep=str2

will list commits mentioned either str1 or str2 in their commit log messages 将在其提交日志消息中列出提及str1或str2的提交

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM