Git clone command

In Git, we copy a repo by cloning it using the git clone command. We can clone a repo no matter where it's stored (local or remote), if we have a URL or path to point it to. A single repository can be cloned any number of times.

Syntax
• git clone <repo-path>
The git clone command takes a URL or path to an existing repository as a parameter.
• git clone github-repo-link directory-name
It cloned the repository in the directory name specified and make it a git repository. When the directory name contains space, it should be put in double quotes.

git clone -b

We can clone only a particular branch from a repository. For this we need to specify the branch name with -b command.

Syntax
git clone -b <Branch name> <Repository URL>