Differences between revisions 13 and 16 (spanning 3 versions)
Revision 13 as of 2007-07-10 06:03:39
Size: 1803
Editor: pool-71-112-20-227
Comment:
Revision 16 as of 2008-01-12 13:31:51
Size: 1788
Editor: abuehl
Comment: lowercase links
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
You have followed TutorialInstall to install ["Mercurial"] already, right? Good! You have followed TutorialInstall to install Mercurial already, right? Good!
Line 5: Line 5:
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. In Mercurial, we do all of our work inside a [:Repository: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.
Line 7: Line 7:
The easiest way to get started with ["Mercurial"] is to use a ["Repository"] that already contains some files and some history. The easiest way to get started with Mercurial is to use a repository that already contains some files and some history.
Line 9: Line 9:
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. To do this, we use the {{{clone}}} command. This makes a [:Clone: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.
Line 41: Line 41:
These files are exact copies of the files in the ["Repository"] we just ["Clone"]d. These files are exact copies of the files in the repository we just cloned.
Line 43: 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, by either ["Pull"]ing or ["Push"]ing. '''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, by either [:Pull:pulling] or [:Push:pushing].
Line 45: Line 45:
At this point, we can start examining some of the history of our new ["Repository"], by continuing to TutorialHistory. At this point, we can start examining some of the history of our new repository, by continuing to TutorialHistory.

----
CategoryTutorial

Tutorial - cloning a repository

You have followed TutorialInstall to install Mercurial already, right? Good!

In Mercurial, we do all of our work inside a [:Repository: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: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 cloned.

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, by either [:Pull:pulling] or [:Push:pushing].

At this point, we can start examining some of the history of our new repository, by continuing to TutorialHistory.


CategoryTutorial

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