You push your local repository to the remote repository using the git push
command after first establishing a relationship between the two with the git remote add [alias] [url]
command. If you visit your Github repository, it will show you the URL to use for pushing. You'll first enter something like:
git remote add origin git@github.com:username/reponame.git
Unless you started by running git clone
against the remote repository, in which case this step has been done for you already.
And after that, you'll type:
git push origin master
After your first push, you can simply type:
git push
when you want to update the remote repository in the future.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…