Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude particular file from GitHub search

Tags:

github

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.

like image 352
Adriano Giovannini Avatar asked Dec 29 '17 13:12

Adriano Giovannini


1 Answers

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:

  • Excluding results from your search
  • A list of qualifiers you can use when searching for code
like image 179
Derek Hopper Avatar answered Nov 16 '22 07:11

Derek Hopper