Adriano Giovannini
Adriano Giovannini

Reputation: 161

Exclude particular file from GitHub search

I would like to know if and how you can exclude from the search results all the repositories that contain a certain type of file.

Specifically, I'm not interested in any kind of project that uses Composer and so I would like to exclude from the search results all the repositories that contain the composer.json file as they are many, occupy completely useless pages and pages that I will never open.

Upvotes: 16

Views: 14080

Answers (1)

Derek Hopper
Derek Hopper

Reputation: 2258

You can use qualifiers to exclude certain filenames from your search. To exclude composer.json from search results, you can do something like this:

-filename:composer.json

The - can be used with any qualifier to exclude results matching the qualifier.

This is what the GitHub documentation says:

Another way you can narrow down search results is to exclude certain subsets. You can prefix any search qualifier with a - to exclude all results that are matched by that qualifier.

Here are some helpful links about searching code on GitHub:

Upvotes: 27

Related Questions