Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I delete a Git branch with TortoiseGit

Is there an option to delete a branch with TortoiseGit?

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

like image 899
Tarion Avatar asked Oct 02 '22 23:10

Tarion


People also ask

How do I remove a specific branch in git?

The command to delete a local git branch can take one of two forms: git branch –delete old-branch. git branch -d old-branch.

How do I delete a TortoiseGit repository?

Use TortoiseGit → Delete to remove files or folders from Git. When you TortoiseGit → Delete a file, it is removed from your working tree immediately as well as being marked for deletion in the repository on next commit.

Why can't I delete my git branch?

If you are sure you want to delete it, run ' git branch -D issue-5632 '. This error is caused because we have some un-merged changes in branch issue-5632 due to which the branch delete has failed. In such case either you can delete the branch forcefully or merge the changes and then perform the delete operation.

How do I delete a branch?

To do that, you use the following command: git push <remote_name> --delete <branch_name>. The branch still exists locally, though. Since it has unmerged changes, you can delete it quickly using git branch -D hotfix after switching back to main.


1 Answers

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

like image 368
Sandro Munda Avatar answered Oct 07 '22 00:10

Sandro Munda