Creating repository clones
Git clone allows you to create a copy of your repository in a new directory or location. It can be used to replicate a remote repository on your local system or create a local clone to be shared over an intranet. This recipe covers the git clone
command. We will learn to create a clone of a remote repository and then take a look at various transport protocols supported by Git for cloning.
Getting ready
You will need Git binaries installed on your local system, plus a remote repository. Note down the full path (clone URL) of the remote repository.
How to do it…
Create a clone of the repository with the git clone
command, as follows:
$ git clone ssh://ubuntu@192.168.0.100:22/home/ubuntu/cookbook.git \ ubuntu_cookbook
You will be asked to enter a password for the user account ubuntu
.
This command will create a new directory named ubuntu_cookbook
and clone the repository cookbook.git into this directory.
How it works…
As seen in the previous example, the git...