I used Github search which is good though sometimes I like to use Google's parameters for better search handling of what I want.
Unfortunately for the first few pages, I am just finding repositories and not the actual code.
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:
If you go jumping about repos you'll see the path to the source code is something like this:
This matches the rule and thus, you won't get anything back when using compliant search engines.
The accepted answer (as of 18 Sep 2013) is incorrect. GitHub's robots.txt does include a rule disallowing
Google follows the rule for the most specific rule, so
If you want to keep your content hidden from Google, the best option is to use a private repository, so nobody can see it. Second best would be to use a branch that is not master.