Reputation: 5196
Clone and pull, these operations both are similar in functioning, so does using clone instead of pull make any sense? I mean why should I use clone if it is possible to achieve same thing by pulling an existing repo.
A team working on some application and later a new user say user2 allotted to that application by company then cloning existing repo or pulling existing repo for new entry(user2), which 1 is better? comparison b/w clone/pull
Upvotes: 2
Views: 1798
Reputation: 2338
These 2 commands are completly different:
First you clone a repository. After that, whenever you want to update this clone bringing the changes from another repo, you pull.
Upvotes: 1
Reputation: 36431
Pulling means that you already have a local repository, and you pull in just the newest changes from the remote repository that are not in your local repository yet.
But if you don't have a local repository yet, cloning creates a new one, pulls everything from the remote repository into your new local repository and updates your working copy to the newest version.
This is the easiest way to start if you join a new project - you need to get all the code once in the beginning.
You can also do the steps for cloning manually, which has the exact same effect (but just doing hg clone https://url_to_remote
is easier):
hg init
)hg pull https://url_to_remote
)hg update
)Upvotes: 7
Reputation: 4061
When you clone a repository then you are making a new copy, this can be an expensive process. Also if you only use clone then you will risk losing any local changes you may have made.
When you pull then this just updates your repository with any changes that have been made on the parent repository, as it is just incorporating differences this will be a much more efficient process.
I recommend you go though this tutorial: http://hginit.com/
Upvotes: 0
Reputation: 3453
Upvotes: 0