Is there a way that I can prevent a public GitHub repository from showing up on search results? And if yes, how can I do this?
Pretty much the opposite of this question.
Since the only part of the repository that GitHub's robots.txt permits search engines to crawl is the master branch, if you remove or rename that then your repository won't be crawled.
If you don't want that, the only other options are to not use GitHub or pay for an account which lets you have private repositories (if you are a student you may be able to get a discount or free upgrade).
Or you can use bitbucket - https://bitbucket.org/
It's free and you can have private repositories.