Git 简明教程
Git - Clone Operation
我们在 Git 服务器上有一个裸存储库,Tom 也推送了他的第一个版本。现在,Jerry 可以查看他的更改。Clone 操作创建远程存储库的实例。
We have a bare repository on the Git server and Tom also pushed his first version. Now, Jerry can view his changes. The Clone operation creates an instance of the remote repository.
Jerry 在自己的主目录中创建一个新目录并执行 clone 操作。
Jerry creates a new directory in his home directory and performs the clone operation.
[jerry@CentOS ~]$ mkdir jerry_repo
[jerry@CentOS ~]$ cd jerry_repo/
[jerry@CentOS jerry_repo]$ git clone gituser@git.server.com:project.git
上述命令将产生以下结果。
The above command will produce the following result.
Initialized empty Git repository in /home/jerry/jerry_repo/project/.git/
remote: Counting objects: 3, done.
Receiving objects: 100% (3/3), 241 bytes, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Jerry 更改为新本地存储库的目录并列出其目录内容。
Jerry changes the directory to new local repository and lists its directory contents.
[jerry@CentOS jerry_repo]$ cd project/
[jerry@CentOS jerry_repo]$ ls
README