Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a git branch in Netbeans?

I am using Netbeans 8 with Git plugin. I have a branch that I would like to delete, but I don't see an option for that. How to do it?

enter image description here

like image 226
zygimantus Avatar asked Apr 17 '15 11:04

zygimantus


People also ask

How do I remove a git branch?

Delete a branch with git branch -d <branch> . The -d option will delete the branch only if it has already been pushed and merged with the remote branch. Use -D instead if you want to force the branch to be deleted, even if it hasn't been pushed or merged yet. The branch is now deleted locally.

How do I remove a remote git branch?

To delete a remote branch, you can't use the git branch command. Instead, use the git push command with --delete flag, followed by the name of the branch you want to delete.


1 Answers

Here's how I proceed in Netbeans 8.1 (without using the terminal):

  1. Team -> Repository -> Repository browser.
  2. Repository browser is opened on the bottom. Go Branches -> Local (or Remote, depending on which one you need to delete).
  3. Select the branch you want to delete, right click on it, and choose Delete option.

enter image description here

I know I'm late, but I hope it'll help somebody in the future.

Footnote: Make sure you're not currently active in the branch you want to delete as the delete option will be greyed out. Switch to another branch then you can delete the one you need.

like image 114
Pavel Vergeev Avatar answered Oct 19 '22 13:10

Pavel Vergeev