Searching code in a specific GitHub branch

Question:

I am trying to search some code in a branch in a GitHub repository.

However this indicates that I can only search the default branch.

Is there a way I can search code in non-default branch in my GitHub repository?

Answer:

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).

Leave a Reply