jxramos
jxramos

Reputation: 8266

Advanced search on github excluding a specific repository

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

Upvotes: 16

Views: 8779

Answers (1)

Christian
Christian

Reputation: 5521

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.

Upvotes: 27

Related Questions