having to go to a browser, open github.com is kind of hassle for those who do not want to leave terminal.
So here is something neat I have learned.
- curl is a unix command (above works on mac too) that retrieves and interacts with URLs. It is commonly already installed.
- "-u" is a curl parameter that specifies the user name and password to use for server authentication.
- If you just give the user name curl will prompt for a password.
- If you do not want to have to type in the password, see githubs api documentation on Authentication
- "-d" is a curl parameter that allows you to send POST data with the request
- You are sending POST data in githubs defined API format
- "name" is the only POST data required; I like to also include "description"
- I found that it was good to quote all POST data with single quotes ' '
- add definition for location and existance of connected (remote) repo on github
- "origin" is a default name used by git for where the source came from
- technically didnt come from github, but now the github repo will be the source of record
- "email@example.com:sanfx" is a ssh connection that assumes you have already setup a trusted ssh keypair with github.
Push local repo to githubgit push origin master
- push to the origin remote (github) from the master local branch