Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advanced search on github excluding a specific repository

Tags:

github

I'm trying to figure out if there's any way to exercise the various fields defined for the github advanced search form that would allow me to effectively exclude hits from a specific repo. In other words I want to do a code search for all hits landing outside a given repository, an inverse repository search if you will.

I may be able to tune the size field with an inequality, but I'm hoping there's something I may be overlooking that has this sort of search in mind. My specific use case is that there's a major monorepo on our remote but there's a small constellation of support repositories which reuse some bits of the main repo that need to be refactored. I'm trying to identify those source hits in the smaller repos that need to be upgraded.

repository options fields from github advanced search

https://github.com/search/advanced?q=test&type=Repositories

like image 586
jxramos Avatar asked Mar 04 '23 01:03

jxramos


1 Answers

Use -repo in the normal search. You can exclude a repository by prepending a hyphen (-).

foo_library -repo:owner1/repoX -repo:owner2/repo

See also docs.github.com or github.community.

like image 103
Christian Avatar answered Mar 05 '23 18:03

Christian