Mercurial - 如何从分叉的父级获取最新更改?

发布于 2024-10-03 23:17:04 字数 260 浏览 0 评论 0原文

我接触 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

坠似风落 2024-10-10 23:17:04

只需使用源存储库作为参数执行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.

红墙和绿瓦 2024-10-10 23:17:04

以下是 3 个基本步骤:

hg pull -u path_to_parent
hg merge
hg commit -m"updates from parent"

或者您可以安装结合了所有这些步骤的 fetch 扩展程序:

hg fetch path_to_parent

Here are 3 essential steps:

hg pull -u path_to_parent
hg merge
hg commit -m"updates from parent"

Or you could install fetch extension that combines all these steps:

hg fetch path_to_parent
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文