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

天大地大妈咪最大 提交于 2019-12-12 07:40:39

问题


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


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/4264192/mercurial-how-to-fetch-latest-changes-from-parent-of-fork

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!