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?
相关问题
- Save html in cookie
- Mercurial compared to private branches in SVN
- Using Subversion and SourceSafe at the same time?
- How to abandon all Mercurial changes that haven
- subversion merge - “has different repository root
相关文章
- Mercurial Commit Charts / Graphs [closed]
- What is the tortoisehg gui equivalent of doing “hg
- How to use Mercurial from Visual Studio 2010?
- SSIS solution on GIT?
- Is it possible to do a “destroy history” in TFS?
- Is there a version control system abstraction for
- Get Android library module version number from ins
- Sprockets::CircularDependencyError application.js
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.
hg clone
is how you make a local copy of a remote repository. The Subversion equivalent issvn checkout
.hg pull
pulls changes from another repository.hg update
applies those changes to the local repository.hg pull -u
is equivalent tohg pull; hg update
. The Subversion equivalent tohg pull -u
issvn 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
then this has the exact same effect as doing
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: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 sinceb
will share the history witha
. This is done using hardlinks and works on all platforms (Windows, Linux, Mac).