How to clone a Git repository from GitHub

Jose Poggioli
Aug 27, 2017 · 3 min read

I started a coding boot camp, and right on the first days of classes I am finding new interesting and useful knowledge that I can apply to my life and personal projects.

If you are working on a development project most likely you are using some sort of cloud based git repository. If you have different people contributing to the project this is a great tool to keep track of all the code that has been done, and to keep track of all the changes that have been made to that code.

One way to check someone’s else work is to download or clone their Git repository into your local machine. That way you will be able to review and work on different files that someone else did right on your computer.

Go to the url of the repository you want to download to your computer. If you do not have it, you probably will have to ask the person that created the repo to provide you with the URL.

Once you open the repository on GitHub it will look something like this:

GitHub repository

Have in mind depending on the work stored in the repository it could have a lot more files than the example above.

Once in this window click on the green button on the right hand side that says ‘Clone or download’:

Clone or download button

Now you will get a popup window with the url for this specific repository:

repo url

Decide in what directory you want to have the cloned repository and navigate there on your terminal window. Once there enter the following command:

git clone ‘repositoryURL’

The repository URL is the one you got from clicking on clone or download in the step above.

Terminal window

if you enter ‘ls’ then you can see that you have a new folder with the name of the repository.

Repository folder

You can now ‘cd’ into the folder and check out and work with all the files from that repository.

The cool thing about this is that this process is not particularly specific to GitHub. If you or your colleagues are using other site for placing their repositories you can probably use the same process to clone their repos. I used this process to cloned a repository from bitbucket just recently.

Voila! now you know how to clone a repository to your local machine and you are able to work on somebody’s else work. Enjoy!

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade