Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching code in a specific GitHub branch

Tags:

git

github

People also ask

How do I do an advanced search on GitHub?

Searching using a visual interface You can search GitHub Enterprise Server using the search page ( https://[hostname]/search ) or advanced search page ( https://[hostname]/search/advanced ). The advanced search page ( https://[hostname]/search/advanced ) provides a visual interface for constructing search queries.


Not from the GitHub web interface itself, as mentioned in "How can I search for a commit message on GitHub?": only the default branch (generally master) is indexed.

Your best bet is to clone the repository, and there, search in all branches (with git log -S for instance).


Using console, I would search for specific code in a specific branch with the following

git grep 'my_search_text' my_branch
  • my_branch should be available locally
  • git grep can perform pattern matching of high complexity (see the documentation)

If you know the filename you can use Find File.

enter image description here

enter image description here

https://github.com/angular/angular/find/6.1.x