如何使用 Mercurial 将上游更改拉入分支?
我已经分叉了一个 Mercurial 存储库,现在我想将主存储库中的更改拉入我的分叉中。如果这是 git,我会做类似的事情...
git remote add upstream <url>
git pull upstream master
我如何在 Mercurial 中做这种事情?
I've forked a Mercurial repository, and now I want to pull the changes from the main repository into my fork. If this were git, I would do something like...
git remote add upstream <url>
git pull upstream master
How do I do this sort of thing in Mercurial?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您还可以修改存储库中的 hgrc 文件
然后您可以执行以下操作
You could also modify your hgrc file in your repo
Then you can do
如果您从要从中提取更改的存储库克隆了存储库,您可以简单地执行以下操作:
如果您从另一个存储库克隆了存储库,您可以:
然后您需要更新您的工作副本:
无论如何,这是基础知识。更多详细信息,请参阅Mercurial:权威指南
If you cloned the repository from the one you want to pull changes from, you can simply do:
If you cloned the repository from another repository, you can:
You'll then need to update your working copy:
That's the basics, anyway. More details are available in the Mercurial: The Definitive Guide
你尝试过pull命令吗?
如果这不起作用,请详细说明。
Have you tried the pull command?
If that does not work, please elaborate.
您还可以修改存储库中的 hgrc 文件以使用特殊路径名 default 和 default-push。
然后你可以从上游(又名默认)拉取
并推送到叉子(又名默认推送)
You could also modify your hgrc file in your repo to use the special path names default and default-push.
Then you can pull from upstream (aka default) with
and push to fork (aka default-push) with