撤消 Mercurial 中的分支创建
如何撤消 Mercurial 中分支的创建?例如,如果我发出命令,
hg branch newbranch
如果我确定输入了错误的名称,如何删除该分支?我猜这一定很简单,但我还没有弄清楚。谢谢!
How can I undo the creation of a branch in Mercurial? For example, if I issue the command
hg branch newbranch
How can I delete this branch if I decide I entered the wrong name? I'm guessing this must be pretty simple to do, but I have yet to figure it out. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您还没有承诺,您可以简单地按照手册进行干净重置(http:// www.selenic.com/mercurial/hg.1.html#commands):
这会将工作目录的分支名称重置为您刚刚创建的分支的父级。
If you haven't committed yet, you can simply do a clean reset as per the manual (http://www.selenic.com/mercurial/hg.1.html#commands):
This will reset the working directory's branch name to the parent of the branch that you just created.
如果你没有向它做出任何承诺,那么它就没有真正被创建。所以只需发出另一个
hgbranch newname
即可。if you haven't committed anything to it, it wasn't really created. so just issue another
hg branch newname
.如果它已经提交:
hgclone -bbranch1[-bbranch2[-b..]]oldreponewrepo
,即除了newbranch之外的每个分支,将产生没有newbranch的新repo。hg strip
在之前查看编辑历史记录在存储库中进行永久更改。
If its already commited:
hg clone -b branch1 [-b branch2 [-b ..]] oldrepo newrepo
, i.e. every branch except newbranch, will result in new repo without the newbranch.hg strip
Look into editing history before making permanent changes in repository.
假设您尚未推送到远程存储库,请启用 mq 扩展并剥离分支。
Assuming you have not pushed to a remote repository, enable the mq extension and strip the branch off.