如果使用git将项目托管到GitHub

Step 1

注册GitHub账号,Create a new repository并获取SSH地址

Step 2

git remote add origin SSH地址
git push -u origin master

需要先做本机的SSH设置
常见错误fatal: remote origin already exists.可通过输入git remote rm origin解决

其他

…or create a new repository on the command line

echo "# -" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin SSH地址
git push -u origin master
…or push an existing repository from the command line

posted @ 2017-03-31 19:10  懒懒猫  阅读(150)  评论(0)    收藏  举报