Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

community creator

How to clone a git repository using the command line

Aparna Pannir

What does it mean to clone a repository?

The clone command in git is used when you want to download an existing git repository to your local computer. This means that you would have a clone or duplicate of the git repository and can start working on it whenever convenient.

git-clone: clones a repository into a new directory.

Usually, the original repository is located on a remote server.

Cloning a repository using the command line

This particular article will focus on cloning a repository using a command line. Follow the directions below:

  • Open GitHub and go to the GitHub repository that you want to clone.
  • Click “Code” and copy the given URL.
click code and copy the URL
click code and copy the URL
  • Open “Git Bash” and change the current working directory to the location where you want the cloned directory.
  • Type git clone in the terminal, paste the URL you copied earlier, and press “enter” to create your local clone.


git clone {repository URL}
Terminal 1


community creator

View all Courses