在本地项目所在目录按以下步骤操作 echo # test >> README.md
git init
git add README.md git add . git commit -m "first commit"
git remote add origin https://github.com/qhorse/test.git
git push -u origin master
$ git remote add origin https://github.com/qhorse/test.git fatal: remote origin already exists.
解决办法如下: 、先输入$ git remote rm origin 、再输入$ git remote add origin https://github.com/qhorse/test.git 就不会报错了! 最后一步上传