Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Find file by its content

Tags:

github

Can I filter files in a GitHub repository by file content?

For example, there is the public repo:

https://github.com/xamarin/mobile-samples.

I know that I can find file by name using this option:

https://github.com/xamarin/mobile-samples/find/master

But, can I filter results to files containing specified text eg. "Entry"?

Is there some query-string which I can use to do that?

I mean something like this: https://github.com/xamarin/mobile-samples?content=entry

like image 396
g_m Avatar asked Dec 15 '18 15:12

g_m


People also ask

How do I search file contents in GitHub?

Select to search in current repository, not "All GitHub". It will display all "Entry" in particular file. Just to add a little something: the syntax seems to be <search term> filename:<filename> and you may search for it in your organization only (by adding org:<your organization name> .

How do I find a file in a repository?

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). This is the correct 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 find exact strings in 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

Just open repository, go to top search bar (where you search for other repos) and type:

Entry

Select to search in current repository, not "All GitHub".

To search for term in particular file of repository type:

Entry filename:example_filename.java

It will display all "Entry" in particular file.

like image 139
Dinko Pehar Avatar answered Sep 27 '22 20:09

Dinko Pehar