Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2006-09-15 05:41:53
Size: 1804
Editor: BenLuo
Comment:
Revision 8 as of 2009-05-19 19:30:59
Size: 1860
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#language zh
Line 3: Line 5:
We have followed ChineseTutorialInstall to install ["Mercurial"] already, right? Good! 我们已经按照 ChineseTutorialInstall 安装了 [[Mercurial]],对吗?很好!
Line 5: Line 7:
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. [[Mercurial]] 中,我们在 [[Repository|仓库]] 里做我们所有的工作。[[Repository|仓库]]是一个目录,它包含所有我们希望保留历史的源代码和这些源代码的历史记录。
Line 7: Line 9:
The easiest way to get started with ["Mercurial"] is to use a ["Repository"] that already contains some files and some history. 最简单开始 [[Mercurial]] 的方法是使用一个已经包含文件和一些历史记录的[[Repository|仓库]]。
Line 9: Line 11:
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. 我们使用 {{{clone}}} 命令来做这个事情。 这生产一个[[Repository|仓库]]的[[Clone|克隆]],它生成一个完整的[[Repository|仓库]]复本,这样我们有一个本地私有的[[Repository|仓库]]来工作。
Line 11: Line 13:
Let's clone a small "hello, world" repository hosted at selenic.com: 让我们克隆一个在 selenic.com 上的 "hello, world" 仓库:
Line 17: Line 19:
If all goes well, the {{{clone}}} command prints this: 如果所有都没问题,{{{clone}}} 命令输出:
Line 27: Line 29:
We should now find a directory called {{{my-hello}}} in our current directory: 我们应该在当前目录下发现一个目录叫 {{{my-hello}}}:
Line 34: Line 36:
在 {{{my-hello}}} 目录,我们应该发现这些文件: 在 {{{my-hello}}} 目录,我们应该发现这些文件:
Line 41: Line 43:
These files are exact copies of the files in the ["Repository"] we just ["Clone"]d. 这些文件是我们刚[[Clone|克隆]]的[[Repository|仓库]]的精确复本。
Line 43: Line 45:
'''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. '''注:''' 在 [[Mercurial]] 中, 每一个[[Repository|仓库]]是自包含的。当你[[Clone|克隆]]一个[[Repository|仓库]]后,新[[Repository|仓库]]变成[[Clone|克隆]]时它的精确复本, 但是后续的两个仓库当中任一方改变都不会在对方显示,除非你用 [[Pull]] 或 [[Push]] 明确地传递改变。
Line 45: Line 47:
At this point, we can start examining some of the history of our new ["Repository"], by continuing to ChineseTutorialHistory. 现在我们可以检查新[[Repository|仓库]]的一些历史记录, 继续 [[ChineseTutorialHistory|教程 - 检查仓库历史]]。
----
CategoryChinese

教程 - 克隆仓库

我们已经按照 ChineseTutorialInstall 安装了 Mercurial,对吗?很好!

Mercurial 中,我们在 仓库 里做我们所有的工作。仓库是一个目录,它包含所有我们希望保留历史的源代码和这些源代码的历史记录。

最简单开始 Mercurial 的方法是使用一个已经包含文件和一些历史记录的仓库

我们使用 clone 命令来做这个事情。 这生产一个仓库克隆,它生成一个完整的仓库复本,这样我们有一个本地私有的仓库来工作。

让我们克隆一个在 selenic.com 上的 "hello, world" 仓库:

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

如果所有都没问题,clone 命令输出:

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

我们应该在当前目录下发现一个目录叫 my-hello

$ ls
my-hello

my-hello 目录中,我们应该发现这些文件:

$ ls my-hello
Makefile  hello.c

这些文件是我们刚克隆仓库的精确复本。

注:Mercurial 中, 每一个仓库是自包含的。当你克隆一个仓库后,新仓库变成克隆时它的精确复本, 但是后续的两个仓库当中任一方改变都不会在对方显示,除非你用 PullPush 明确地传递改变。

现在我们可以检查新仓库的一些历史记录, 继续 教程 - 检查仓库历史


CategoryChinese

ChineseTutorialClone (last edited 2009-05-19 19:30:59 by localhost)