跟踪 Mercurial 的分支
作为一名 Git 用户,我发现为多个 Mercurial 远程存储库设置多个目录很不方便,因为我想在它们之间快速切换,尤其是在 IDE 中工作时。
我正在尝试以某种方式从 git 复制远程分支系统,在这里我可以简单地在分支之间切换并推送到我选择的分支。
如何使用 Mercurial 轻松跟踪同一目录中的多个远程分支?
As a Git user, I find it inconvenient to set up multiple directories for multiple Mercurial remote repositories, as I want to quickly switch between them, especially when working in an IDE.
I'm trying to somehow replicate the remote branches system from git, where I can simply switch between branches and push to the one I choose.
How can I easily track multiple remote branches in the same directory with Mercurial?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 Mercurial 大师,但这是我会尝试的方法。
没有直接的方法可以使用 Mercurial 执行此操作,但可以使用组合:
初始设置需要您:
pull
的默认路径设置为“.” (为了防止在不带参数调用hg Push
时意外推送到错误的跟踪分支)书签
来代表 master 的提示(用 Git 来说)然后,当您想要跟踪新的遥控器时:
hgrc
中为遥控器创建一个路径条目bookmark
完成后,您可以执行以下操作
: ..审查分支并决定是否要合并...然后
I am not a Mercurial guru, but this is the method I would try.
There is no direct method of doing this with Mercurial, but it can be accomplished using a combination of:
The initial setup would require you to:
pull
to '.' (to prevent accidentally pushing to the wrong tracking branch whenhg push
is invoked with no arguments)bookmark
at your tip to represent the tip of master (in Git speak)Then when you want to track a new remote:
hgrc
for the remotebookmark
for the remoteWith that done your can do things like:
...review the branch and decide if you want to merge...then