This kind of thing is best suited for a private repo (github is still ok, just make it private) - cause it's most likely of no use to anyone but that single user.
https://www.google.com/search?q=site%3Agithub.com+inurl%3A.s...
This is dangerous. But then again, is it Github's responsibility to keep these people from shooting themselves in the foot?
No.
Found via Github search
That's Ned Ruggeri, co-founder of App Academy (http://www.appacademy.io/). His HN account: http://news.ycombinator.com/user?id=ruggeri
Such as when it is a key file, or is a known credential file -- "amazon_s3.yml" for example, they should send a warning to the committer.
And then show a big red flag on the website if the repo is public.
And of course, remove the results from search.
I know it's not github's responsibility, but it would help make the web a bit safer.