37. Cloning repositories

Goals

  • To learn to make copies of the repositories.

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

01 Go to your working directory

Go to the working directory and clone your hello repository.

Run:

cd ..
pwd
ls

NOTE: Now we are in the work directory.

Result:

$ cd ..
$ pwd
/Users/marina/Documents/Presentations/githowto/auto
$ ls
hello

At this point you should be in your “working” directory. It should contain a single repository named “hello”.

02 Create a clone of the hello repository

Let’s create a clone of the repository.

Run:

git clone hello cloned_hello
ls

Result:

$ git clone hello cloned_hello
Cloning into cloned_hello...
done.
$ ls
cloned_hello
hello

Right now there should now be two repos in your working directory: the original “hello” repo and the cloned repository named “cloned_hello”.

SVN?
© 2011-2014 Git How To. All rights reserved / Contact us