What benefit is there to use --grep-reflog?

坚强是说给别人听的谎言 提交于 2019-12-10 06:53:00

问题


I noticed in the documentation you can specify the parameter --grep-reflog

--grep-reflog=<pattern>

Limit the commits output to ones with reflog entries that match the specified pattern (regular expression). With more than one --grep-reflog, commits whose reflog message matches any of the given patterns are chosen. It is an error to use this option unless --walk-reflogs is in use.

I kind of wanted clarification on how this is different from --grep. What benefit is there for looking through actions made through the git reflogs? Is it just so you know what is available in git reflog so if you wanted to access it, you can?


回答1:


--grep only search applies to commits reachable from a branch head. You would use --grep-reflog to search instead commits that are accessible from a reflog entry, which might not otherwise be accessible from an existing branch. I think this is useful primarily for error recovery (finding a commit that is otherwise lost so that you can recover it).



来源:https://stackoverflow.com/questions/29524375/what-benefit-is-there-to-use-grep-reflog

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!