See the [API](https://help.github.com/articles/setting-the-default-branch/) and the [curl tutorial](https://gist.github.com/caspyin/2288960).