30. Cloning repositories

Goals

  • Learn how to make copies of the repositories.

If you are working in a team, the following 8 lessons are quite important to understand because you almost always have to work with cloned repositories.

01 Go to your repositories directory

Run

cd ..
pwd
ls

Now we are in the repositories directory.

Result

$ cd ..
$ pwd
/home/alex/githowto/repositories
$ ls
work

At this point you should be in your repositories directory. It should contain a single repository named work.

02 Create a clone of the work repository

Let's create a clone of the repository.

Run

git clone work home
ls

Result

$ git clone work home
Cloning into 'home'...
done.
$ ls
home
work

Right now there should now be two repos in your working directory: the original work repo and the cloned repository named home.