Git 提示fatal: remote origin already exists 错误怎么解决

今天连接远程仓库得时候报了一个错误:fatal: remote origin already exists  这个呢解决只需两步


1.先删除远程git仓库 git remote rm origin


2.在添加到远程仓库就行了 git remote add origin 仓库地址

3、如果输入$ git remote rm origin 还是报错的话,error: Could not remove config section 'remote.origin'. 我们需要修改config文件的内容  vi .git/config


然后把 [remote “origin”] 那一行删掉就好了。

猜你喜欢

转载自blog.csdn.net/liuying93/article/details/80701693