Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github code search on any branch

Tags:

github

It is against general git workflow to make feature changes on a master branch. Sow= if I were to fork a repo my work ends up in .. feature branches..

How can I search those non-master branches on github?

Actually - even advanced search on Github seems to not find much of anything except for repository names and README files. It is not searching the codebase??

Here is an example of searching the yahoo user account for Process

enter image description here

: that should come up with dozens if not hundreds of hits. But we get .. four hits ..

enter image description here

So in general the github code search is a bit of a mystery . I really want to find certain code snippets .. either on master or another branch .. is there a way to do this??

like image 481
WestCoastProjects Avatar asked Mar 29 '17 14:03

WestCoastProjects


People also ask

How do I search for a specific code 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. You will also get a sidebar with the facet counts of language breakdown of the results and repository breakdowns.

How do you check from which branch a branch is created?

Use Status Command Your branch is up to date with 'origin/master'. The first line shows which branch are you on. The second shows your upstream branch if there are any set.

Is forking the same as branching?

Forking creates a full copy of your repository, whereas branching only adds a branch to your exiting tree. The file size of branch can vary depending on the branch that you are on. Under the hood git readily accesses the different files and commits depending on what branch you are using.


1 Answers

There are tabs just below the header of the page - Repositories, Code, Commits, etc. If I click the Code tab I get 2k+ results.

There are some restrictions with searching code on GitHub, however, and branches other than master are not considered in the search. Also, only files smaller than 384 KB and repositories with less than 500,000 files are searchable. You can find more information related to searching code on GitHub here: https://help.github.com/articles/searching-code/

like image 186
vanogrid Avatar answered Nov 03 '22 02:11

vanogrid