开发学院

您的位置:首页>教程>正文

教程正文

Git 克隆库

Git  克隆库

  现在,我们在Git服务器上有一个空的版本库,Tom也提交了他的第一个版本,那么此时Jerry可以看到版本库更新了。克隆操作将创建远程存储库的本地实例。

  Jerry在其工作目录中创建新文件夹并执行克隆操作。

[jerry@CentOS ~]$ mkdir jerry_repo
[jerry@CentOS ~]$ cd jerry_repo/
[jerry@CentOS jerry_repo]$ git clone gituser@git.server.com:project.git

  上述操作将产生以下结果。

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@CentOS jerry_repo]$ cd project/
[jerry@CentOS jerry_repo]$ ls
README