如何使用 TortoiseGit 删除 Git 分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9705534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:11:49  来源:igfitidea点击:

How do I delete a Git branch with TortoiseGit

gitbranchtortoisegit

提问by Tarion

Is there an option to delete a branch with TortoiseGit?

是否可以选择使用TortoiseGit删除分支?

I found a solution for the commandline. Is there an implementation in TortoiseGit?

我找到了命令行解决方案。TortoiseGit 中有实现吗?

回答by Sandro Munda

You should read this article: Remote branches with TortoiseGit

您应该阅读这篇文章:使用 TortoiseGit 进行远程分支

According to this blog post:

根据这篇博文:

...remove the local branch by first opening up the Checkout/Switchdialog to get at the Browse refsdialog.

...通过首先打开Checkout/Switch对话框以获取对话框来删除本地分支Browse refs

enter image description here

在此处输入图片说明

In the Browse refsdialog we can right click on the local branch and choose to delete it.

Browse refs对话框中,我们可以右键单击本地分支并选择将其删除。

enter image description here

在此处输入图片说明

To delete a remote branch we can do the same thing, but instead of right clicking on our local branch we expand the remotes tree in the left part of the dialog and then locate the remote branch.

要删除远程分支,我们可以做同样的事情,但不是右键单击本地分支,而是展开对话框左侧的远程树,然后找到远程分支。

enter image description here

在此处输入图片说明

回答by R?zvan Flavius Panda

You can Shift+ Right Click on the cloned repository and choose Browse Referencesfrom TortoiseGit submenu:

您可以Shift+ 右键单击​​克隆的存储库并Browse References从 TortoiseGit 子菜单中选择:

Click on remotes in the left tree view, and then right click the branch you wish to remove and click on Delete remote branch.

单击左侧树视图中的遥控器,然后右键单击要删除的分支并单击Delete remote branch

You can also get rid of the "shift"+right click: Go to TortoiseGit settings -> "Set extended context menu" and uncheck "Browse References"

您还可以摆脱“shift”+右键单击:转到 TortoiseGit 设置->“设置扩展上下文菜单”并取消选中“浏览参考”

回答by Yue Lin Ho

Open log dialog first, there are ways to delete branch(es):

首先打开日志对话框,有删除分支的方法:

  1. Right click on branch
    enter image description here

  2. Right click on commit
    enter image description here

  3. In Browse referencesdialog
    enter image description here

  4. Delete merged branches
    enter image description here

  5. Delete those remote-tracking brancheswhich its remote branches are not exist on remote
    enter image description here
    [Note] if you want to prune non-exist branches each time you perform fetch, you can do these:
    enter image description here

  1. 右键单击分支
    在此处输入图片说明

  2. 右键单击提交
    在此处输入图片说明

  3. 浏览参考对话框中
    在此处输入图片说明

  4. 删除合并的分支
    在此处输入图片说明

  5. 如果你想在每次执行 fetch 时修剪不存在的分支,请删除那些其远程分支在远程[注意]上不存在的远程跟踪分支,你可以这样做:
    在此处输入图片说明

    在此处输入图片说明