Mercurial - 如何从分叉的父级获取最新更改?
我接触 Mercurial 已经有一段时间了,现在我已经在 BitBucket 上建立了几个项目,一个是另一个项目的分叉。
我已经能够毫无问题地对每个存储库进行更改,但我不明白的一件事是如何使分支与父存储库的更改保持同步?
在我分叉了一个存储库后,我只能看到该存储库到 X 修订版的提交,此后我只能看到分叉自己的提交,而没有新的父级提交。
我非常确定,在我涉足 git 的过程中,我能够重新调整到最新的父版本,但那是很久以前的事了,我不想猜测我的坏习惯:-)
I've been dabbling with Mercurial for a short while now, and I've now set up several projects on BitBucket, one forking off of the other.
I've been able to make changes to each repo with no problem, but one thing I can't figure out, is how to keep the fork up-to-date with changes from the parent repo?
After I've forked a repo, I only see the commits from that repo up to X revision, after which point I only see the fork's own commits, no new parent commits.
I'm pretty certain that during my dabbling with git, I was able to rebase to the latest parent revision, but that was awhile back and I'd rather not guess my way into bad habits :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需使用源存储库作为参数执行
pull
即可。它将拉取您上次拉取之后所做的所有更改(或者从您分叉项目时起,如果没有执行拉取)。之后你将有一些额外的头,你必须将它们与你的头合并。
Just perform the
pull
with the source repository as an argument. It will pull all the changes done after your previous pull (or from the time you forked the project, if no pulls were performed).After that you will have some additional heads, which you have to merge with your ones.
以下是 3 个基本步骤:
或者您可以安装结合了所有这些步骤的 fetch 扩展程序:
Here are 3 essential steps:
Or you could install fetch extension that combines all these steps: