How to delete a branch in the remote repository using EGIT?

How to delete the remote branch itself in sourceforge with all files in it, using egit ?


Solution 1:

Go to Team > Remote > Push… from the menu. Select your repository, and click Next. Under Remote ref to delete… select your branch and click Add spec. Then click Finish. This should delete the remote branch.

how-to-delete-remote-branch-in-eclipse-egit

Solution 2:

(Update March 2012)

As tukushan mentions in the comment:

In Egit 1.3.0, this only deletes the remote tracking branch in the local repository, not the remote branch.

As Michael Mior details in his (upvoted) answer, you need to push "nothing" to the remote branch : git push origin :branch, which from git1.7+ is better coded as git push origin --delete branch.

With Egit, see "Delete Ref Specifications section":

Remote ref to delete in Egit


(Original answer December 2011)

You can also check out the very latest release of EGit (1.2, released yesterday December 23rd, 2011). You now have another way to delete a remote

From its EGit/New and Noteworthy/1.2:

In the commit graph area, there is a new context menu action "Delete Branch" allowing to delete a branch.
It will be enabled if a branch exists for the currently selected commit, which is not checked out.
If there is a single branch on this commit, which is not checked out, this action will delete this branch immediately.
If multiple such branches exist, a dialog will be shown asking which branches should be deleted.
If commits become unreachable on "Delete Branch" a confirmation dialog will be shown to prevent accidental unreachability of commits.

It remains to be tested if that option can delete a branch for a commit on a remote namespace (a commit part of a remote repo and fetched in your local repo).