Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub: How to do case sensitive search for the code in repository?

I want to do a case sensitive search for a particular piece of code in a GitHub repository. Is it possible?

I checked https://help.github.com/articles/searching-code/ and didn't find such a syntax rule.

like image 304
Zhongjun 'Mark' Jin Avatar asked Aug 07 '15 19:08

Zhongjun 'Mark' Jin


People also ask

Is GitHub search case sensitive?

Search is not case sensitive.

How do I search inside code on GitHub?

To search within a particular repository or organization, navigate to the repository or organization page, type what you're looking for into the search field at the top of the page, and press Enter.

How do I search for a string in a git repository?

Git includes a grep command to search through commits to a repo as well as the local files in the repo directory: git grep. Sometimes it is useful to search for a string throughout an entire repo, e.g. to find where an error message is produced.


1 Answers

Use grep or git grep in your local clone. The GitHub search has a lot of limitations. I think the worst of these is that it only shows the first two matches from any file, so I just avoid it whenever possible.

like image 122
db48x Avatar answered Sep 17 '22 01:09

db48x