我的情况是这样的…某人在同一个回购中删除了他本地&远程回购……
大多数在Stack Overflow或其他网站上询问这类问题的人都有分支仍然显示在他们的远程跟踪分支列表git branch -a
底部的问题:
* master
develop
feature_blah
remotes/origin/master
remotes/origin/develop
remotes/origin/feature_blah
remotes/origin/random_branch_I_want_deleted
然而,在MY的情况下,分支不应该在那里,是本地的:
* master
develop
feature_blah
random_branch_I_want_deleted
remotes/origin/master
remotes/origin/develop
remotes/origin/feature_blah
当我做以下任何一项时,它不会在本地被删除:
$ git prune
我还试过:
$ git remote prune origin
$ git fetch --prune
更多有用的信息:当我检查git remote show origin
时,它是这样的:
* remote origin
Fetch URL: utilities:homeconnections_ui.git
Push URL: utilities:homeconnections_ui.git
HEAD branch: master
Remote branches:
master tracked
develop tracked
feature_blah tracked
other123 tracked
other444 tracked
other999 tracked
Local branches configured for 'git pull':
develop merges with remote develop
feature_blah merges with remote other999
master merges with remote master
random_branch_I_want_deleted merges with remote random_branch_I_want_deleted
Local refs configured for 'git push':
develop pushes to develop (local out of date)
master pushes to master (up to date)
feature_blah pushes to feature_blah(up to date)
注意,它只在名为Local branches configured for 'git pull':
的部分中
为什么?