Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 641
Ismail Marmoush Avatar asked Dec 24 '11 15:12

Ismail Marmoush


People also ask

Is it okay to delete a branch in your remote repository?

It is safe to delete your local branch after you pushed your changes to your own remote repository. The pull request is unrelated to this, because it is simply a request to the maintainers of the original repository to merge your changes back into their code base.

How do I remove a branch from my GitHub repository?

On GitHub.com, navigate to the main page of the repository. Above the list of files, click Branches. Scroll to the branch that you want to delete, then click . If you try to delete a branch that is associated with at least one open pull request, you must confirm that you intend to close the pull request(s).

How do I remove a branch from a remote repository?

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. You also need to specify the remote name ( origin in this case) after git push .


2 Answers

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

like image 141
Michael Mior Avatar answered Oct 19 '22 06:10

Michael Mior


(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).

like image 34
VonC Avatar answered Oct 19 '22 06:10

VonC