使用git,我如何在所有分支中搜索字符串? [英] Using git, how could I search for a string across all branches?
问题描述
使用git,我如何在所有本地分支中的所有文件中搜索给定的字符串?
Github特定:是否可以跨所有github分支? (在我的远程github回购中有几个远程分支,理想情况下,我不必为此搜索而降低成本。)
你可以在Git仓库中做这件事:
$ b $ pre $ g $ grepstring / regexp$(git rev-list - 所有)
Github高级搜索具有代码搜索功能:
代码搜索将遍历所有公开托管在GitHub上的代码。您也可以按以下方式过滤:
language:
repo:
路径:
Using git, how could I search within all files in all local branches for a given string ?
Github specific : is it possible to perform the above search across all github branches ? (There are several remote branches on my remote github repo that ideally I wouldn't have to bring down for this search..)
You can do this on a Git repo:
git grep "string/regexp" $(git rev-list --all)
Github advanced search has code search capability:
The Code search will look through all of the code publicly hosted on GitHub. You can also filter by:
- the language:
language:
- the repository name (including the username):
repo:
- the file path:
path:
这篇关于使用git,我如何在所有分支中搜索字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!