今天使用git 添加远程github仓库的时候提示错误:fatal: remote origin already exists.

最后找到解决办法如下:
1、先删除远程 Git 仓库
$ git remote rm origin
2、再添加远程 Git 仓库
$ git remote add origin git@github.com:dreamingyin/JavaDataBase.git
如果执行 git remote rm origin 报错的话,我们可以手动修改gitconfig文件的内容
$ vi .git/config
把 [remote “origin”] 那一行删掉就好了。
作者使用git添加远程github仓库时,遇到fatal: remote origin already exists错误。解决办法是先删除远程Git仓库,再重新添加。若删除时报错,可手动修改gitconfig文件,删掉[remote “origin”]那一行。
531

被折叠的 条评论
为什么被折叠?



