git 如何使用EGIT删除远程存储库中的分支?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8625406/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to delete a branch in the remote repository using EGIT?
提问by Ismail Marmoush
How to delete the remote branch itself in sourceforge with all files in it, using egit ?
如何使用 egit 在 sourceforge 中删除包含所有文件的远程分支本身?
回答by Michael Mior
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.
Team > Remote > Push…
从菜单转到。选择您的存储库,然后单击Next
。在Remote ref to delete…
选择您的分支下并单击Add spec
。然后点击Finish
。这应该删除远程分支。
回答by VonC
(Update March 2012)
(2012 年 3 月更新)
As tukushanmentions in the comment:
正如tukushan在评论中提到的:
In Egit 1.3.0, this only deletes the remote tracking branch in the local repository, not the remote branch.
在 Egit 1.3.0 中,这只会删除本地存储库中的远程跟踪分支,而不是远程分支。
As Michael Miordetails 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
.
正如Michael Mior在他的(upvoted)回答中详细说明的那样,您需要将“nothing”推送到远程分支: git push origin :branch
,从 git1.7+ 开始,最好将其编码为git push origin --delete branch
.
With Egit, see "Delete Ref Specifications section":
使用 Egit,请参阅“删除参考规范部分”:
(Original answer December 2011)
(原答案 2011 年 12 月)
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
您还可以查看 EGit 的最新版本(1.2,昨天于 2011 年 12 月 23 日发布)。您现在有另一种删除遥控器的方法
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.
在提交图区域,有一个新的上下文菜单操作“
Delete Branch
”,允许删除分支。
如果当前选定的提交存在分支,则将启用它,该提交未检出。
如果此提交上有一个未检出的分支,则此操作将立即删除此分支。
如果存在多个这样的分支,将显示一个对话框,询问应删除哪些分支。
如果提交在“删除分支”上变得无法访问,将显示一个确认对话框以防止提交意外无法访问。
It remains to be tested if that option can delete a branch for a commit on a remotenamespace (a commit part of a remote repo and fetched in your local repo).
如果该选项可以删除远程命名空间上提交的分支(远程存储库的提交部分并在本地存储库中获取),则仍有待测试。