Thanks to David Winterbottom (@codeinthehole). See https://twitter.com/codeinthehole/status/1346774847221870593
- Open Chrome > Settings
- Search "manage search engines" and click into it
- Click "Add"
- Give "search engine" a name. e.g GitHub - Some repo
- Give "keyword" a shortcut e.g gh
- Give "URL with %s in place of query" the URL below:
https://github.com/search?q=%s+repo%3A[ORG]%2F[REPO]&type=Code
Replace `[ORG]` with your organisation/username and `[REPO]` with the name of your repository.
e.g for Django:
https://github.com/search?q=%s+repo%3Adjango%2Fdjango&type=Code
-
Click "Add".
-
Search! e.g Type "gh NameOfComponent" in your address bar.
Even better still, replace $ORG for your organisation, and you have 2 new search engines that do not need to be setup per repo, precisely what you want is a search engine to look into all your repos and all your code and nobody else's.
Search Engine:
GitHub ReposKeyword:
ghrURL:
https://github.com/search?q=org%3A$ORG+%s&type=repositoriesSearch Engine:
GitHub CodeKeywork:
ghURL:
https://github.com/search?q=org%3A$ORG+%s&type=code