1

在我的设置中,这似乎可以删除远程分支:

git push origin :foo

因为当我第一次这样做时,它成功了,但第二次失败了,因为它说远程分支不存在(如预期的那样)。到目前为止,一切都很好。

这不起作用:

git remote prune origin

它返回时没有输出,并且我所有已删除遥控器的本地跟踪分支仍然存在。

4

1 回答 1

2

By "local tracking branches", do you mean branches you created to track remote branches? git remote prune won't delete those. It'll only delete the remote branches (i.e., it'll delete origin/foo, but not my-local-foo that tracked origin/foo).

You can confirm that origin/foo was deleted by checking the output of

$ git branch -r
于 2010-12-17T17:53:41.937 回答