Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub search - how to exclude (logical NOT) company or user from search results

Tags:

In this search query (test it live ↗) I'm searching for:

  • all pull requests
  • by user limonte (me)
  • for the vaadin company

How can I search for all my pull requests except (logical NOT) those for vaadin company?


These two options I tried without success:

  • is:pr author:limonte user:!vaadin
  • is:pr author:limonte user:NOT vaadin
like image 319
Limon Monte Avatar asked Apr 04 '17 08:04

Limon Monte


People also ask

How do I exclude a GitHub repository from search?

1 Answer. Show activity on this post. Use -repo in the normal search. You can exclude a repository by prepending a hyphen (-).

Does GitHub do exact search?

To enable exact matches with quotes you need to follow your search with the "in:file" modifier. The matches are not quite exact, the word "class" will have to follow the word "filter", but it seems there can be 0 or more spaces or symbols characters between the two words.

How do I global search on GitHub?

GitHub Codesearch can be found at github.com/codesearch and will let you type in anything you're looking for in source code and get highlighted results of any files in our public repositories that match.


2 Answers

Prefixing any search qualifier with a - excludes all results that are matched by that qualifier.

For example, you might be interested in finding all "cats" repositories with more than 10 stars that are not written in JavaScript:

cats stars:>10 -language:javascript 

You might also want to find all issues mentioning @defunkt that are not in repositories in the GitHub organization:

mentions:defunkt -user:github 

The answer for your question is:

is:pr author:limonte -user:vaadin


For more refer the GitHub Search Syntax

like image 85
Nilay Vishwakarma Avatar answered Oct 01 '22 14:10

Nilay Vishwakarma


It looks like you can just use the word NOT now:

hello NOT world matches repositories that have the word "hello" but not the word "world."

https://help.github.com/en/articles/understanding-the-search-syntax

I got tired of getting unit tests in my searches, so I was searching like so:

NOT test in:path AND "search-term" in:file 
like image 30
ADJenks Avatar answered Oct 01 '22 13:10

ADJenks