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

  • Allows you to bring changes from a remote repository

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)