Loading...

Git Tutorial

Cloning repositories in git

Lets learn how to make copies of the repositories.

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

Step1: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/kwikl3arn/Documents/Presentations/gitdemo/auto
$ ls
hello

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


Step2: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”.