Mercurial命令结合汞拉;拥抱 [英] Mercurial command to combine hg pull; hg up
问题描述
如何将Mercurial命令hg pull
和hg update
合并为一个?
How can I combine the Mercurial commands hg pull
and hg update
into one?
推荐答案
很显然,hg pull -u
是这里的答案.
Obviously, hg pull -u
is the answer here.
但是,有一个警告值得一提:hg pull -u
并不完全等同于hg pull
&& hg update
.文档中简要提到了这一点,但是如果您初次接触它,可能会感到惊讶.如果没有什么要提取的内容(例如没有新的变更集进来),则hg pull -u
不会更新.如果您在发出该命令之前还不为所动,这可能会造成一些混乱.
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.
这篇关于Mercurial命令结合汞拉;拥抱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!