Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法删除git remote_Git_Github - Fatal编程技术网

无法删除git remote

无法删除git remote,git,github,Git,Github,每次我使用“git init”。一些旧的回购协议似乎是起源 git remote -v origin https://github.com/a.git (fetch) origin https://github.com/a.git (push) 我不能删除主题 git remote remove origin fatal: Remote-Repository not found: 'origin' 我可以添加新的遥控器 origin https://github.com/

每次我使用“git init”。一些旧的回购协议似乎是起源

git remote -v       
origin  https://github.com/a.git (fetch)
origin  https://github.com/a.git (push)
我不能删除主题

git remote remove origin
fatal: Remote-Repository not found: 'origin'
我可以添加新的遥控器

origin  https://github.com/a.git (fetch)
origin  https://github.com/a.git (push)
bucket  https://b@bitbucket.org/b.git (fetch)
bucket  https://b@bitbucket.org/b.git (push)

如果我愿意,可以删除“b”(在这两种情况下),但不可能删除“a”


我尝试删除旧的全局git文件,尝试设置url,删除本地repo。。。没有工作

我怀疑您的全局git配置中有一个远程
源站
。要验证:

git config --global --get-regexp ^remote.origin.
如果命令至少返回
remote.origin.url
从全局配置中删除远程:

git config --global --remove-section remote.origin

在现有存储库中运行
git init
,不会更改任何现有设置。如果你正在创建一个新的空存储库,phd的答案就是这个问题
git config --global --remove-section remote.origin