例如,我想在特定的回购中搜索上个月提交的TODO评论。
答案 0 :(得分:1)
git log
有--grep
标记,可帮助您搜索结果。将其与-p
结合使用即可查看修补程序的内容和--since
,然后您就可以了:
$ git log -p --since="1 month" --grep TODO
答案 1 :(得分:1)
您可以使用git log -S
。此选项通常称为the gitpickaxe。
答案 2 :(得分:0)
@ Code-Apprentice,谢谢你的提示。在查看了git log
帮助的10%之后,最好的方法似乎是:
git log -S TODO --since=2017-10-01 -p . > tmp_file
然后我可以在tmp_file
搜索TODO。这是我找到我想要的最快捷方式。