Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial - how to fetch latest changes from parent of fork?

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

like image 424
Jon L. Avatar asked Nov 24 '10 06:11

Jon L.


2 Answers

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.

like image 174
zerkms Avatar answered Sep 23 '22 17:09

zerkms


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
like image 11
Denis Ivin Avatar answered Sep 23 '22 17:09

Denis Ivin