项目添加远程仓库是提示:fatal: remote origin already exists

解决方法:
1.删除远程git仓库
git remote rm origin
2.再添加远程git仓库
$ git remote add origin git@github.com:Arnoscy/web.git
主要Arnoscy换成自己的github账户名,否则无法推送你代码到远程库。
把本地库的所有内容推送到远程库上提示:
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:Arnoscy/web.git'
导致上面错误,是因为本地仓库是空的,只要提交文件就行。

解决办法:
输入以下命令提交即可
1. git add .
2. git commit -m 'xxxx'
3. git push -u origin master
网友评论