我的情况是这样的......在同一个仓库工作的人已经从他的本地和远程仓库中删除了一个分支......
git branch -a
大多数在 Stack Overflow 或其他网站上询问过此类问题的人都会在底部的远程跟踪分支列表中显示分支问题:
* master
develop
feature_blah
remotes/origin/master
remotes/origin/develop
remotes/origin/feature_blah
remotes/origin/random_branch_I_want_deleted
但是,在我的情况下,不应该存在的分支是本地的:
* 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':
为什么?