Is 'pull' a synonym for 'clone' in a Mercurial source-control repository?

I’m seeing the command ‘pull‘ and wondering how that’s different from a ‘clone‘. Both terms seem to imply retrieving code from some remote repository. Is there some subtle distinction here?

  • Git clone Error: RPC failed; result=56, HTTP code = 200
  • how to download single folder OR file in gitlab repository
  • Is there a simple way to “git describe” a remote repository?
  • git clone doesn't download everything
  • git clone with NTLM proxy hangs after resolving deltas
  • can't clone git repos via http; info/refs not found
  • Why did Git and Mercurial use SHA1
  • 'Forgetting' a dead-end branch
  • Create “duplicate copy” of github repository
  • Is Git a good version control system for web development (HTML/CSS/Javascript) on a corporate project?
  • Version control system with incremental updates
  • What makes merging in DVCS easy?
  • 3 Solutions collect form web for “Is 'pull' a synonym for 'clone' in a Mercurial source-control repository?”

    hg clone is how you make a local copy of a remote repository. The Subversion equivalent is svn checkout.

    hg pull pulls changes from another repository. hg update applies those changes to the local repository. hg pull -u is equivalent to hg pull; hg update. The Subversion equivalent to hg pull -u is svn update.

    Use clone when you need to make a new repository based on another. Use pull later to transfer new changesets into the clone. You cannot use clone to fetch just the newest changesets — that is what pull is for. The pull command will compare the two repositories, find the missing changesets in your repository and finally transfer those.

    However, you are right that there are similarities between clone and pull: they both transfer history between repositories. If you clone first

    hg clone

    then this has the exact same effect as doing

    hg init hg
    cd hg
    hg pull
    hg update

    You get the exact same history in both cases. The clone command is more convenient, though, since it also edits the .hg/hgrc file for you to setup the default path:

    default =

    This is what lets you do hg pull in the repository without specifying a URL. Another advantage of using clone is when you work with repositories on the same disk: hg clone a b will be very fast and cheap in terms of disk space since b will share the history with a. This is done using hardlinks and works on all platforms (Windows, Linux, Mac).

    clone creates a new repository as a copy of an existing repository.

    pull imports all changesets (not already present) from another repository into an existing repository.

    Git Baby is a git and github fan, let's start git clone.