Hoạt động Clone trong Git

Chúng ta có một repository rỗng trên máy chủ và Tom cũng đẩy phiên bản đầu tiên của anh ta. Bây giờ, Jerry có thể quan sát những thay đổi của anh ta. Hoạt động clone (tạo bản sao) tạo một instance của repository từ xa.

Jerry tạo một thư mục mới trong thư mục home của anh ta và thực hiện hoạt động mô phỏng.

[jerry@CentOS ~]$ mkdir jerry_repo

[jerry@CentOS ~]$ cd jerry_repo/

[jerry@CentOS jerry_repo]$ git clone gituser@git.server.com:project.git

Lệnh trên sẽ tạo kết quả sau:

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 thay đổi thư mục này tới thư mục nội bộ mới và liệt kê nội dung thư mục của nó.

[jerry@CentOS jerry_repo]$ cd project/

[jerry@CentOS jerry_repo]$ ls
README