Mercurial - how to fetch latest changes from paren

2019-03-24 12:08发布

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 :-)

2条回答
别忘想泡老子
2楼-- · 2019-03-24 12:26

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.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-03-24 12:37

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
查看更多
登录 后发表回答