What's the difference between update and pull?

hg update : http://www.selenic.com/mercurial/hg.1.html#update

  • Update the repository's working directory (the "working copy") to the specified revision of the repository

hg pull : http://www.selenic.com/mercurial/hg.1.html#pull

So when you do an hg pull, you bring changes to your repository which is under .hg. It will not reflect in your working directory.

After that, when you do a hg update, the changes are brought to your working copy.

Your repo                                 Remote Repo
 \                                        \
  |                hg pull                 |
  |-.hg  <-------------------------------- |-.hg
  |   |  --------------------------------> |
  |  hg update       hg push               |
  |   |                                    |
  |- working folder                        |- working folder

This is very usual confusion when coming from subversion like version control systems.

In subversion : svn update bring the changes from central repo server to your working copy

But in DVCSs , you have both a local repository and working copy. So update does exactly the same but pulls the changes from your local repo to local working copy.


Mercurial is a distributed revision control system, so you have the whole repo history as well as your version of the code (called the "working copy").

pull brings in remote changes to your local repo.

update changes your working copy to match the newest version in your local repo.

So if you clone a remote branch and keep running update, your code won't change because you're never downloading remote code. If you keep running pull, then your code won't change because you're never using the remote code (applying it to your working version of the code).


The pull command pulls changes from the parent repository but does not actually make any changes to the files in the repository.

Update command is used to actually update the files in the repository.

Refer: https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#What%27s_the_difference_between_hg_pull_and_hg_update.3F