Cloning or Checking out a repository with GIT

C

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.

About the author

By Jamie

My Books