You can press . in any GitHub repository to open it in an online version of VSCode. That should make searching in your project very easy. Answer from gastrognom on reddit.com
🌐
GitHub
github.com › explore
Explore GitHub · GitHub
June 10, 2026 - The go-to web for your AI coding agent — local-first search, fetch, crawl & research over MCP. No API keys, no cloud, $0/query.
Discussions

How to search things in github repository?
You can press . in any GitHub repository to open it in an online version of VSCode. That should make searching in your project very easy. More on reddit.com
🌐 r/github
8
14
December 27, 2021
git - Search code inside a Github project - Stack Overflow
Is there a way to grep for something inside a Github project's code? I could pull the source and grep it locally, but I was wondering if it's possible through the web interface or a 3rd-party alter... More on stackoverflow.com
🌐 stackoverflow.com
what is up with the github reddit search?
Friendly reminder that all top level comments must: start with "answer: ", including the space after the colon (or "question: " if you have an on-topic follow up question to ask), attempt to answer the question, and be unbiased Please review Rule 4 and this post before making a top level comment: http://redd.it/b1hct4/ Join the OOTL Discord for further discussion: https://discord.gg/ejDF4mdjnh I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/OutOfTheLoop
11
24
May 16, 2022
GitHub now requires a login to search
Github/Microsoft owns copilot, a AI tool trained on github repositories. Github/Microsoft doesn't want other competing tools to be able to scrape github in order to maintain their leverage. More on reddit.com
🌐 r/linux
175
508
November 26, 2023
🌐
Gitsearchai
gitsearchai.com
AI GitHub Search
Find codebases using natural language. Choose how you want to search. Fast natural-language GitHub search for repositories and people.
🌐
GitHub
github.com › features › code-search
GitHub Code Search · GitHub
Code search makes it effortless to quickly find what I'm looking for in my code, or across all of GitHub
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-github-search-like-a-pro
How to Use GitHub Search Like a Pro
May 21, 2026 - In the search bar, you'll see four suggestions: the first is "Search in this repository," the second is "Search in this organization," the third is "Search all of GitHub," and the last is the code section "Display similar files."
🌐
Grep
grep.app
Code Search | Grep by Vercel
Effortlessly search for code, files, and paths across a million GitHub repositories.
🌐
GitHub
docs.github.com › en › search-github › getting-started-with-searching-on-github › about-searching-on-github
About searching on GitHub - GitHub Docs
March 15, 2022 - After typing a search query, you can press Enter to go to the full search results view, where you can see each match and a visual interface for applying filters. For more information, see Searching using a visual interface. ... You must be signed into a personal account on GitHub to search for code across all public repositories.
Find elsewhere
🌐
GitHub
docs.github.com › en › repositories › working-with-files › using-files › navigating-code-on-github
Navigating code on GitHub - GitHub Docs
To search for a symbol in the repository as a whole, in the symbols pane, click Search for this symbol in this repository. To search for a symbol in all repositories on GitHub, click all repositories.
🌐
freeCodeCamp
freecodecamp.org › news › github-search-tips
GitHub Search Tips – How to Search Issues, Repos, and More Effectively on GitHub
October 17, 2022 - In order to find detailed information about something on the internet, you need to have the correct searching skills. It's not any different with GitHub – to find detailed info you can utilize common filter, sort, and searching techniques to easily find specific issues and pull requests of a given project.
🌐
GitHub
docs.github.com › en › search-github › searching-on-github
Searching on GitHub - GitHub Docs
You can use qualifiers to narrow your search and focus on specific categories of information.
🌐
GitHub
docs.github.com › en › search-github
Search on GitHub documentation - GitHub Docs
Learn how to use the search functions available on GitHub to find different types of information, like projects, people, and code.
🌐
GitHub
gist.github.com › usametov › af8f13a351a66fb05a9895f11417dd9d
how to search github.com for multiple topics · GitHub
With the in qualifier you can restrict your search to the repository name, repository description, repository topics, contents of the README file, or any combination of these. ... Thanks for the information! The method works for topics less than 7, otherwise github API complains: More than five AND / OR / NOT operators were used.
🌐
GitHub
docs.github.com › en › search-github › searching-on-github › searching-issues-and-pull-requests
Searching issues and pull requests - GitHub Docs
December 31, 2021 - You can search for issues and pull requests globally across all of GitHub, or search for issues and pull requests within a particular organization.
Top answer
1 of 12
326

2023-2025+: https://github.com/search?type=Code

Example inside a project: https://github.com/search?q=repo%3Agit%2Fgit+rebase&type=code

Update May 2023:

The new code search and code view is now generally available (May. 2023)

(As noted by holydragon in the comments, that does require to sign in to GitHub first)

At GitHub Universe last year, we announced a total redesign of GitHub's code search and navigation experience, powered by our all-new code search engine that we built from scratch.
And in February, we announced our public beta.

Today, we are rolling out this feature to all GitHub users.

Check out our blog post to learn more about how GitHub's new code search and code view can help you search, navigate, and understand your code.
And if you have feedback, please share it with us in our feedback discussion.


Update Dec. 2021: search has been improved again, with Search for an exact string, with support for substring matches and special characters, or regexps.

But only on cs.github.com, and still in beta (waitlist applies)


Update January 2013: a brand new search has arrived!, based on elasticsearch.org:

A search for stat within the ruby repo will be expressed as stat repo:ruby/ruby, and will now just workTM.
(the repo name is not case sensitive: test repo:wordpress/wordpress returns the same as test repo:Wordpress/Wordpress)

Will give:

And you have many other examples of search, based on followers, or on forks, or...


Update July 2012 (old days of Lucene search and poor code indexing, combined with broken GUI, kept here for archive):

The search (based on SolrQuerySyntax) is now more permissive and the dreaded "Invalid search query. Try quoting it." is gone when using the default search selector "Everything":)

(I suppose we can all than Tim Pease, which had in one of his objectives "hacking on improved search experiences for all GitHub properties", and I did mention this Stack Overflow question at the time ;) )

Here is an illustration of a grep within the ruby code: it will looks for repos and users, but also for what I wanted to search in the first place: the code!


Initial answer and illustration of the former issue (Sept. 2012 => March 2012)

You can use the advanced search GitHub form:

  • Choose Code, Repositories or Users from the drop-down and
  • use the corresponding prefixes listed for that search type.

For instance, Use the repo:username/repo-name directive to limit the search to a code repository.
The initial "Advanced Search" page includes the section:

Code Search:

The Code search will look through all of the code publicly hosted on GitHub. You can also filter by :

  • the language language:
  • the repository name (including the username) repo:
  • the file path path:

So if you select the "Code" search selector, then your query grepping for a text within a repo will work:


What is incredibly unhelpful from GitHub is that:

  • if you forget to put the right search selector (here "Code"), you will get an error message:
    "Invalid search query. Try quoting it."

  • the error message doesn't help you at all.
    No amount of "quoting it" will get you out of this error.

  • once you get that error message, you don't get the sections reminding you of the right association between the search selectors ("Repositories", "Users" or "Language") and the (right) search filters (here "repo:").
    Any further attempt you do won't display those associations (selectors-filters) back. Only the error message you see above...
    The only way to get back those arrays is by clicking the "Advance Search" icon:

  • the "Everything" search selector, which is the default, is actually the wrong one for all of the search filters! Except "language:"...
    (You could imagine/assume that "Everything" would help you to pick whatever search selector actually works with the search filter "repo:", but nope. That would be too easy)

  • you cannot specify the search selector you want through the "Advance Search" field alone!
    (but you can for "language:", even though "Search Language" is another combo box just below the "Search for" 'type' one...)


So, the user's experience usually is as follows:

  • you click "Advanced Search", glance over those sections of filters, and notice one you want to use: "repo:"
  • you make a first advanced search "repo:jruby/jruby stat", but with the default Search selector "Everything"
    => FAIL! (and the arrays displaying the association "Selectors-Filters" is gone)
  • you notice that "Search for" selector thingy, select the first choice "Repositories" ("Dah! I want to search within repositories...")
    => FAIL!
  • dejected, you select the next choice of selectors (here, "Users"), without even looking at said selector, just to give it one more try...
    => FAIL!
  • "Screw this, GitHub search is broken! I'm outta here!"
    ...
    (GitHub advanced search is actually not broken. Only their GUI is...)

So, to recap, if you want to "grep for something inside a Github project's code", as the OP Ben Humphreys, don't forget to select the "Code" search selector...

2 of 12
89

To seach within a repository, add the URL parametes /search?q=search_terms at the root of the repo, for example:

https://github.com/bmewburn/vscode-intelephense/search?q=phpstorm

In the above example, it returns 2 results in Code and 160 results in Issues.

🌐
GitHub
docs.github.com › en › search-github › searching-on-github › searching-for-repositories
Searching for repositories - GitHub Docs
August 26, 2020 - You can search for repositories on GitHub and narrow the results using these repository search qualifiers in any combination.
🌐
GitHub
github.com › gwen001 › github-search
GitHub - gwen001/github-search: A collection of tools to perform searches on GitHub. · GitHub
A collection of tools to perform searches on GitHub. - gwen001/github-search
Starred by 1.5K users
Forked by 357 users
Languages   Python 57.1% | PHP 40.7% | Shell 2.2%
🌐
GitHub
github.com › github › docs › blob › main › content › search-github › github-code-search › understanding-github-code-search-syntax.md
docs/content/search-github/github-code-search/understanding-github-code-search-syntax.md at main · github/docs
To search within a set of repositories, you can combine multiple repo: qualifiers with the boolean operator OR. For example: repo:github-linguist/linguist OR repo:tree-sitter/tree-sitter
Author   github
🌐
GitHub
github.com › github › docs › blob › main › content › search-github › searching-on-github › finding-files-on-github.md
docs/content/search-github/searching-on-github/finding-files-on-github.md at main · github/docs
To search for files in these directories, {% ifversion code-search-upgrade %}use the path code search qualifier{% else %}use the filename code search qualifier{% endif %}. Alternatively, you can customize which directories are excluded by default using a .gitattributes file.
Author   github
🌐
GitHub
github.com › github › docs › blob › main › content › search-github › getting-started-with-searching-on-github › about-searching-on-github.md
docs/content/search-github/getting-started-with-searching-on-github/about-searching-on-github.md at main · github/docs
In addition to the search bar, you can search {% data variables.product.github %} using the {% data variables.search.search_page_url %} or {% data variables.search.advanced_url %}. {% ifversion command-palette %}Alternatively, you can use the ...
Author   github