GitHub – Are Sources Parsed by Search Engines?

github

I used Github search which is good though sometimes I like to use Google's parameters for better search handling of what I want.

site:github.com foreach

Unfortunately for the first few pages, I am just finding repositories and not the actual code.

Best Answer

If the search engine crawlers honour the robots.txt then no, you won't be able to use external search engines to search for code hosted on GitHub.

Here's the line from their robots.txt file disallowing that:

Disallow: /*/*/blob/*

If you go jumping about repos you'll see the path to the source code is something like this:

https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor.rb

This matches the rule and thus, you won't get anything back when using compliant search engines.