首页 > 解决方案 > 无法删除 git 远程

问题描述

每次我使用'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)

或者

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

如果我喜欢(在这两种情况下),则删除“b”,但无法删除“a”

我试图删除旧的全局 git 文件,尝试 set-url,删除本地 repo ...没有工作

标签: gitgithub

解决方案


我怀疑你origin的全局 git 配置中有一个遥控器。核实:

git config --global --get-regexp ^remote.origin.

如果命令返回至少remote.origin.url从全局配置中删除远程:

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

推荐阅读