是否可以在 Mercurial 中重新打开已关闭的分支?
据我所知,可以关闭 Mercurial 中的命名分支,这样它就不会出现在 hg Branch
列表中:
hg commit --close-branch -m 'close badbranch, this approach never worked'
是否可以在需要时重新打开该分支?
I understand that it is possible to close a named branch in Mercurial, so that it will not appear in the hg branches
list:
hg commit --close-branch -m 'close badbranch, this approach never worked'
Is it possible to later re-open the branch if need be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您只需
hg update
到已关闭的分支,然后再执行一次hg commit
,它就会自动重新打开。闭合
标志仅用于从hg分支
和hg头
中过滤出闭合分支,除非您使用--lined
code> 选项 - 它不会阻止您使用分支。You can just
hg update
to the closed branch then do anotherhg commit
and it will automatically reopen.The
closed
flag is just used to filter out closed branches fromhg branches
andhg heads
unless you use the--closed
option - it doesn't prevent you from using the branches.不,此命令将创建一个同名的新分支。
只是忘记它已经关闭了。切换到分支,进行更改并提交。它将自动重新打开。完成后,您可以再次关闭它。
No, this command will create a new branch with the same name.
Just forget that it's closed. Switch to the branch, make the changes and commit. It will be automatically reopened. When you're done you can close it again.
尝试以下操作:
现在对其中一个文件进行一个小的更改,然后提交它
然后推送它
现在您应该能够正常工作。
try with following:
Now make a small change to one of the file and then commit it
then push it
Now you should be able to work normally.
试试这个。
执行前切换到关闭的分支。 ( hg up close_branch )
hg st
touch a
add a
hg commit -m '重新打开关闭的分支'
这将重新打开关闭的分支。
Try this.
Switch to the closed branch before executing. ( hg up closed_branch )
hg st
touch a
add a
hg commit -m 'reopening the closed branch'
This will reopen the closed branch.