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

匆匆过客 提交于 2020-07-05 03:13:57

问题


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

回答1:


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




回答2:


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


来源:https://stackoverflow.com/questions/43201579/github-search-how-to-exclude-logical-not-company-or-user-from-search-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!