Practical Web Programming

Wednesday, March 20, 2013

How to Clone a Remote Git Repository

To clone a remote git repository, run the following command in the terminal/console. 


$ git clone https://github.com/kabalweg/MyTestProject.git


This will create a directory named MyTestProject in the current path, initializes a .git directory inside it, pulls down all the data of that repository, and checks out a working copy of the latest version. If you go into the new git directory, you'll see the project files in there, ready to be worked on.   

If you want change the name of the directory to be created, use the command below.   


$ git clone https://github.com/kabalweg/MyTestProject.git YourTestProject 


Where YourTestProject is the name of the directory you want when git clones the repository.

This example uses github as the remote repository, but you can use this format with any repo provider like beanstalk.

0 comments:

Recent Post