views:

175

answers:

1

Hello

I a xampp setup for php.

I have created a new repository at D:/xampp/htdocs/cart and i am using Mercurial along with Netbeans.

I am working on a locally and a lone developer.

The cart is installed and works at my localhost hXXp://localhost/cart

If I make a change to a clone repository, since it is not the directory which runs on the localhost, what makes it useful ? Everything resides on my local computer.

I am new to DVCS.

What purpose does Cloning a repository achieve ?

+3  A: 

Cloning serves two basic purposes:

  1. It makes the idea of branching easier: It's simpler to clone the repository to work on a new feature on the side, while leaving the main repository as-is until you're done and able to pull and merge the changes back into the main repo. While Mercurial does allow to have several branches in the repository, the cloning approach is often easier.

  2. The second purpose is pretty much the same thing that happens when you make a checkout from a centralized VCS like Subversion. In DVCS, however, you don't just checkout whatever revision you want to work with, but the whole repository. This way, you don't depend on the "central" repository anymore. Since you're a lone developer on a single computer, this one isn't too important for you.

Either way, you can always push / pull changes from one repository to another, so the changes made in the clone aren't lost in your main repository. There's a good introduction to Mercurial at http://hgbook.red-bean.com/ .

Hope this helps.

balpha
Thanks for the link. So as far as working locally, should i use the cloning feature ?
Ibn Saeed
Until you want to either create a branch (in the development style meaning, not in the technical one) or want to publicize / share your work in some way: You probably won't need to. You can use it to make a backup of the repo, but just copying the whole directory would do that for you as well.
balpha
Alright, thanks
Ibn Saeed
Concerning my last comment (the "backup by copy" part): Run hg -v help clone for an explanation of some caveats that cloning by copying repository directories has.
balpha