Upload a new Github Repo from the command line

1. create the repo via curl

Replace <this>:

curl -u '<username>' https://api.github.com/user/repos -d '{"name":"<repo name>"}'

2. upload

Assuming you’ve created your git repo locally, added and committed then:

git remote add origin git@github.com:<username>/<repo name>.git
git push -u origin master

3. check

It should be at:

https://github.com/<username>/<repo name>

Leave a Reply

Your email address will not be published. Required fields are marked *