我正在尝试对不久前启动的存储库进行一些补救性的 git 清理工作。当我运行 gitbranch -a 时,我得到以下输出:
$ git branch -a
* master
staging
remotes/origin/master
remotes/origin/staging
remotes/pythonanywhere/master
remotes/pythonanywhere/staging
remotes/staging/staging
remotes/staging/staging
Remote 不再存在。运行 git remote -v 时它不会显示在列表中。
这似乎也意味着我无法删除 Remote 。
get fetch -p
、git Remote prune staging
也不起作用。
运行 git config --local -l 时, Remote 也不会显示在 Remote 列表中
编辑:
在尝试解决此问题时,建议的可能重复的问题/答案不起作用。由于某种原因, Remote 被遗弃了。请参阅下面已接受的答案以了解有效的方法。
最佳答案
Is this the same question you have?
git remote prune origin
prunes tracking branches not on the remote.
关于git - 如何删除不再存在的 git 远程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45743630/