Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 github 上,当我尝试在私有存储库中搜索我的源代码时,它总是显示来自 master 分支的结果。有没有办法从另一个分支获得结果?
如果您使用zsh,这里有一个衬里来做到这一点:
zsh
$ zipgrep 'string' =(curl -sL https://github.com/org/repo/archive/branch.zip)
我终于找到了方法!
进入settings您的 github 存储库,然后更改您要搜索的默认分支:
settings
现在你可以从这个分支中搜索源代码了!