Git: How to rename a GitHub repo

GitHub allows to rename your repos. I real­ly like this solu­tion.

Install curl if you haven’t and use ter­mi­nal (or cyg­win under win­dows):

user=MyUserName
pass=MyPassword
newName='{"name": "NewNameForRepo"}'
oldName="MyRepo"
curl -u "$user:$pass" -X PATCH -d "$newName" https://api.github.com/repos/$user/$oldName