我想搜索所有可能的引用(提交/分支/标签)、所有提交消息、所有分支名称和所有提交内容。
由于还没有人建议一系列命令,并且如果您还没有自己制作它:
git config alias.findall '!f() { echo -e "\nFound in refs:\n"; git for-each-ref refs/ | grep $1; echo -e "\nFound in commit messages:\n"; git log --all --oneline --grep="$1"; echo -e "\nFound in commit contents:\n"; git log --all --oneline -S "$1"; }; f'
它链接了这三个命令:
# for branches and tags we use for-each-ref and pipe the result to grep
git for-each-ref refs/ | grep $1
# for commit messages we use the grep option for log
git log --all --oneline --grep="$1"
# and for commit contents, the log command has the -S option
git log --all --oneline -S "$1"
所以现在你可以这样做
git findall something
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)