1.

Git Clone

Answer»

git clone is a command which is used to clone or copy a target repository.

The following image shows an illustration of the git clone command. Using the command, a copy of the original repository is created.

How to clone a repository?


  • Open Github and navigate to the target repository which needs to be cloned.

  • Under the repo name, click on the tab Clone or Download.

  • An option named Clone with HTTPS appears.

  • Copy the Clone URL.

  • Open a command line and use the command: git clone <repo_URL>

In this way, a clone of the target repository can be made.

Clone a specific branch from the repository.

A very useful feature of the git clone is that it allows cloning a specific branch of the target repository without having to clone the entire repository.
To clone a specific branch, you need to use the command -b to specify the branch. The following command is used:

git clone -b <Branch_name> <Repo_URL>


Discussion

No Comment Found