如何从Visual Studio 2015中删除已删除的Git分支 [英] How do I remove deleted Git branches from Visual Studio 2015

查看:190
本文介绍了如何从Visual Studio 2015中删除已删除的Git分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使删除了该分支,Visual Studio仍继续显示我拉出的任何分支(并且我没有将其作为所选分支).

Visual Studio continues to show any branch I've pulled, even after that branch has been deleted (and I do not have it as the selected branch).

  • "git fetch --all --prune"不会删除它们. git config
  • "remote.origin.prune true"(此处建议)不会删除它们.
  • "git fetch --all --prune" does not remove them. git config
  • "remote.origin.prune true" (suggested here) does not remove them.

如何从系统中删除已删除的分支?

How can I remove the deleted branches from my system?

更新:我需要一种确定哪些分支消失并删除它们的方法.如果我们专门选择它们,那么迟早有人会误删除正在使用的分支.

Update: I want an approach that determines what branches are gone and deletes them. If we select them specifically then sooner or later someone will delete a branch in use by mistake.

推荐答案

prune是关于删除遥控器上不再存在的任何远程跟踪引用的.

prune is about removing any remote-tracking references that no longer exist on the remote.

因此,如果分支仍然存在于远程端,则不会在本地将其删除.

So if the branch still exists on the remote side, it won't be deleted locally.

如果分支是在本地删除(使用Visual Studio),其远程跟踪实例仍将在下一次推送时重新创建.

If the branch is deleted locally (with Visual Studio), its remote tracking instance will still be re-created at the next push.

您需要确保分支也已在远程端删除:

git push origin --delete abranch

这篇关于如何从Visual Studio 2015中删除已删除的Git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆