Petrus Theron
Petrus Theron

Reputation: 28856

Mercurial command to combine hg pull; hg up

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

Upvotes: 15

Views: 9623

Answers (4)

Mark
Mark

Reputation: 462

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.

Upvotes: 1

djc
djc

Reputation: 11731

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.

Upvotes: 30

Eldad Assis
Eldad Assis

Reputation: 11045

You can use:

hg pull -u

Read the documentation for more options.

Upvotes: 2

adrianm
adrianm

Reputation: 14726

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

Upvotes: 4

Related Questions