...

/

Git Clone

Git Clone

Learn how to clone remote repositories to your local machine in this lesson.

The git clone command

We can use the git clone command to clone or copy the entire codebase of a project from a remote repository and set it up as a local repository on our machines.

While cloning the project, two more actions occur as well:

  1. The git clone command will also create a remote link to the remote repository being cloned and name it origin. This is similar to manually entering the command git remote add origin <remote_repository_url>.

  2. It will copy and set up the primary branch, which is the master branch in most cases, as the active branch in the working directory. ...