Cloning or Checking out a repository with GIT Cloning or Checking out a repository with GIT

You have your own GIT repository or you wish to checkout a copy of a publicly or privately available repository to your computer.

To checkout or as GIT calls it, clone, a repository the git clone command. This command accepts many different arguments. In your command line, type: git help clone for the full supported list.


Be sure you have installed posh-git as I described in posh-git: the only GIT command line tool I use

99% of the times when I've wished to clone/checkout a GIT repository, I simply supply the URL to the repository. For example, I have a repository of several Knockout.js Examples.

git clone with posh-git

To checkout this repository to my local computer, I open up my command line (in my case Powershell with the awesome posh-git), navigate to the directory where I store my GIT repositories (in my case C:\GitHub) and perform the following command:

git clone https://github.com/endyourif/Knockout.js-Examples

This will download all of the files in the repository into a new folder under my C:\GitHub folder called Knockout.js-Examples. Of course the directory name will change based on the name of the repository being cloned to your local computer.

Published on Feb 15, 2019

Tags: Github | git | posh-git | git clone

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.