How do I delete a Git branch with TortoiseGit

GitBranchTortoisegit

Git Problem Overview


Is there an option to delete a branch with TortoiseGit?

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

Git Solutions


Solution 1 - Git

You should read this article: Remote branches with TortoiseGit

According to this blog post:

...remove the local branch by first opening up the Checkout/Switch dialog to get at the Browse refs dialog.

enter image description here

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

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

Solution 2 - Git

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

Click on remotes in the left tree view, and then right click the branch you wish to remove and click on 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"

Solution 3 - Git

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 references dialog
    enter image description here

  4. Delete merged branches
    enter image description here

  5. Delete those remote-tracking branches which 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTarionView Question on Stackoverflow
Solution 1 - GitSandro MundaView Answer on Stackoverflow
Solution 2 - GitRăzvan Flavius PandaView Answer on Stackoverflow
Solution 3 - GitYue Lin HoView Answer on Stackoverflow