Differences between revisions 9 and 10
Revision 9 as of 2005-09-03 20:04:47
Size: 1625
Comment:
Revision 10 as of 2005-09-21 19:31:49
Size: 1774
Editor: AdrienBeau
Comment: Updated to Mercurial 0.7 output, some cleanups and clarifications
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
Let's clone a small "hello, world" repository hosted at selenic.com:
Line 15: Line 17:
If all goes well, the {{{clone}}} command prints no output. (It seems like new versions of hg prints some progress -- MadsKiilerich.) We should now find a directory called {{{my-hello}}} in our current directory: If all goes well, the {{{clone}}} command prints this:

{{{
 requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 2 changesets
with 2 changes to 2 files
}}}

We should now find a directory called {{{my-hello}}} in our current directory:
Line 21: Line 33:
Inside the {{{my-hello}}} directory, we'll find some files:
Inside the {{{my-hello}}} directory, we should find some files:
Line 25: Line 38:
 hello.c Makefile  Makefile  hello.c
Line 27: Line 40:
Line 29: Line 43:
'''Note''': in ["Mercurial"], each ["Repository"] is self-contained. When you ["Clone"] a ["Repository"], the new ["Repository"] becomes an exact copy of the existing one at the time of the ["Clone"], but subsequent changes in either one''will not show up'' in the other unless you explicitly transfer them. '''Note''': in ["Mercurial"], each ["Repository"] is self-contained. When you ["Clone"] a ["Repository"], the new ["Repository"] becomes an exact copy of the existing one at the time of the ["Clone"], but subsequent changes in either one ''will not show up'' in the other unless you explicitly transfer them.

Tutorial - cloning a repository

We have followed TutorialInstall to install ["Mercurial"] already, right? Good!

In ["Mercurial"], we do all of our work inside a ["Repository"]. A ["Repository"] is a directory that contains all of the source files that we want to keep history of, along with complete histories of those source files.

The easiest way to get started with ["Mercurial"] is to use a ["Repository"] that already contains some files and some history.

To do this, we use the clone command. This makes a ["Clone"] of a ["Repository"]; it makes a complete copy of another ["Repository"] so that we will have our own local, private one to work in.

Let's clone a small "hello, world" repository hosted at selenic.com:

 $ hg clone http://www.selenic.com/repo/hello my-hello

If all goes well, the clone command prints this:

 requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 2 files

We should now find a directory called my-hello in our current directory:

 $ ls
 my-hello

Inside the my-hello directory, we should find some files:

 $ ls my-hello
 Makefile  hello.c

These files are exact copies of the files in the ["Repository"] we just ["Clone"]d.

Note: in ["Mercurial"], each ["Repository"] is self-contained. When you ["Clone"] a ["Repository"], the new ["Repository"] becomes an exact copy of the existing one at the time of the ["Clone"], but subsequent changes in either one will not show up in the other unless you explicitly transfer them.

At this point, we can start examining some of the history of our new ["Repository"], by continuing to TutorialHistory.

TutorialClone (last edited 2015-10-28 15:22:27 by alishamsulqamar)