删除已删除的远程的远程跟踪分支 [英] Remove remote tracking branches for removed remote
问题描述
如果我从存储库中删除了一个远程服务器(假设我删除了远程服务器origin
),是否可以快速删除该远程服务器的所有远程跟踪分支?
If I remove a remote from my repo (suppose I delete the remote origin
), is there a quick way to remove all of the remote tracking branches for that remote?
我知道git branch -dr
,但是我必须为每个跟踪分支AFAIK执行一次此操作.还有git remote prune
,但我认为这需要遥控器的名称,在这种情况下,该名称不再存在.
I'm aware of git branch -dr
, but I'd have to do this one time for each tracking branch AFAIK. There is also git remote prune
but I think that requires the name of the remote, which no longer exists in this case.
推荐答案
如果您删除远程,将自动删除所有远程跟踪分支:
If you remove a remote, all remote tracking branches are removed automatically:
删除
rm
删除名为<name>
的遥控器.远程的所有远程跟踪分支和配置设置都将被删除.
remove
rm
Remove the remote named<name>
. All remote-tracking branches and configuration settings for the remote are removed.
这篇关于删除已删除的远程的远程跟踪分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!