Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search a github repository for the file defining a given function

I'd like to search a public repository on github to find where the software defines a given function. It seems this should be straight forward using the advanced search. Not sure if I'm not understanding the filters or if the functions just are not defined.

For example, imagine I want to find where Hadley's facet_wrap function is defined within the ggplot2 repository (it's here.)

I try the advanced search bar selecting Search "Code", written in "R" and enter

facet_wrap repo:ggplot2

And I get no results. Have I formed the query incorrectly?

like image 648
cboettig Avatar asked Feb 22 '12 19:02

cboettig


People also ask

How do I search for a function 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.

How do I search for a specific file in GitHub?

If you're looking for a filename in specific repository, you can just press t and start typing the file name (see: GH keyboard shortcuts). Save this answer.

Can you search within a GitHub repo?

Searching in Your Git RepoYou can search for a commit or any particular string.

How do I search for exact phrases on GitHub?

state the specific string you're looking for using the "intext:" search operator. add the programming language you're interested in, using the "ext:" operator (i.e. "ext:py", "ext:R", "ext:rb", etc.) search in all public repos in Github using the "site:" operator mrgloom mentioned.


1 Answers

You need user/repo as a search term.

facet_wrap repo:hadley/ggplot2

gives 41 results.

like image 144
kohske Avatar answered Nov 09 '22 00:11

kohske