git.pngGit

Git Clone

In this article, we will learn how to clone a repository from GitHub using git clone command.

Total Views:   1849


In this article, we will learn how to clone a repository using the git clone command from GitHub. Git Clone command creates a copy/clone of the target repository. Target repository can be either a Remote Repository (for example, GitHub, GitLab, Bitbucket, etc.) or a local repository.  Below is the git command syntax used for the cloning.

git clone <Repository_Url>

Steps to clone a repository from Git are mentioned below:

Go to the GitHub repository page which you want to clone. Click on the Green Code button as highlighted in the below image in order to copy the Git repository HTTPS web URL path.

 

Click on the Copy icon to copy the Git repository HTTPS web URL path.

 

Now go to the location where you want to clone the repository in your local system. Right-Click on file explorer to open the context menu and click on the Git Bash Here option as shown in the below image.

 

In Git Bash, type “git clone <Paste_Git_Repository_Path_Here>” and click on enter.

 

Git repository will be clone in the system in few minutes (Time taken by cloning of the repository depends on the size of the project, internet speed, and other factors)

 

Once the project is cloned successfully, change the current directory through Git Bash to the location where .git folder is present. As we have cloned the entire project, we can also check the logs using “git log” command.

 

Note: If you are looking to initialize the Git repository (either for a new or existing project) on your local system, Please read Git init tutorial here.