This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

clone [July 11, 2011, 12:20 a.m.]


Cloning a repository enables us to work locally with files that originate on a remote computer. In this task, we will clone a remote repository from Github (a popular software collaboration community).

clone

The clone command takes the URL to a Git repository as an argument:

git clone git://github.com/p2pu/lernanta.git
Initialized empty Git repository in /home/brylie/dev/py/lernanta/.git/
remote: Counting objects: 15337, done.
remote: Compressing objects: 100% (4307/4307), done.
remote: Total 15337 (delta 10852), reused 14989 (delta 10554)
Receiving objects: 100% (15337/15337), 7.00 MiB | 134 KiB/s, done.
Resolving deltas: 100% (10852/10852), done.

As you can see, the clone command creates an empty repository and then downloads all 'objects' (files) from the remote repository.