But specifically when it comes to asking for the Github url (or the like): that assumes that the code they have worked on is open source. There are plenty of good hires out there that may not have participated in open source but still have plenty of code they've created. I think asking for a public repo is too heavily weighted towards open-source wonks.
I'm content asking the candidate to point me to something they've created. I work on webapps so presumably for the candidate that would be a public facing website. And then i study it. And then I grill them hard on the details of their implementation.
In addition I find git to be fostering bad habbits (no default push of private branches), and github to be an abomination (stuff that relates to my code and source control should not be accessed in a 3th party website, but in the tool itself).