Mercurial command to combine hg pull; hg up

∥☆過路亽.° 提交于 2019-11-30 01:53:26

问题


How can I combine the Mercurial commands hg pull and hg update into one?


回答1:


Obviously, hg pull -u is the answer here.

However, there's a caveat that deserves mentioning: hg pull -u is not exactly equivalent to hg pull && hg update. This is briefly mentioned in the documentation, but it can be surprising if you first run into it; if there's nothing to pull (e.g. no new changesets came in), then hg pull -u doesn't update. This can be slightly confusing if you weren't on a head before issuing the command.




回答2:


type hg help pull and you will see the -u switch




回答3:


You can use:

hg pull -u

Read the documentation for more options.




回答4:


The hg fetch extension will do the same once enabled. However, it has fallen out of favor and is noted as an "unloved feature" by the Mercurial team.



来源:https://stackoverflow.com/questions/15241394/mercurial-command-to-combine-hg-pull-hg-up

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