http://blog.csdn.net/cc198877/article/details/7639130
Git 命令参数及用法详解 & Linux编程环境下版本控制 Git使用
如果使用HTTPS:
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 https://github.com/guochy2012/test.git
git push -u origin master
Push an existing repository from the command line
git remote add origin https://github.com/guochy2012/test.git
git push -u origin master
如果采用SSH:
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:guochy2012/test.git
git push -u origin master
Push an existing repository from the command line
git remote add origin git@github.com:guochy2012/test.git
git push -u origin master
使用HTTPS需要每次输入密码,SSH则不用,但SSH需要配置密钥 。
关于怎么产生密钥可以参见《Generating SSH Keys》一文