##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
##Push an existing repository from the command line
git remote add origin git@github.com:alexpchin/<reponame>.git
git push -u origin master
This command worked for me.
curl -u USERNAME:ACCESS_TOKEN https://api.github.com/user/repos -d '{"name":"myDirName"}' #this will create the repo in github.
I doesn't work if I just enter my username and wait for the password prompt, or enter my password after my username. I'm not sure why, but the access token worked first time, no stress.
Does anyone know why it fails with username & password? just out of interest, I suspect it's a security issue.