Cloning Repositories

Goals

  • Learn how to make copies of repositories.

Go to the work directory

Go to the working directory and make a clone of your hello repository.

Execute:

  1. cd ..
  2. pwd
  3. ls

NOTE: Now in the work directory.

Output:

  1. $ cd ..
  2. $ pwd
  3. /Users/jim/Downloads/git_tutorial/work
  4. $ ls
  5. hello

At this point you should be in your “work” directory. There should be a single repository here named “hello”.

Create a clone of the hello repository

Let’s make a clone of the repository.

Execute:

  1. git clone hello cloned_hello
  2. ls

Output:

  1. $ git clone hello cloned_hello
  2. Cloning into 'cloned_hello'...
  3. done.
  4. $ ls
  5. cloned_hello
  6. hello

There should now be two repositories in your work directory: the original “hello” repository and the newly cloned “cloned_hello” repository.