How to clone/download a GitHub Repository
Tags: webdev, beginners, github, discuss
Published: 2022-01-14 02:24:58

Sol addy: 4mgnTysrA7kQVYCsE2CJcaJzpX8xPxGPoKPz2LyiN782

So, as a beginner myself, i've been finding it pretty difficult to find shit. And by shit I mean tutorials on how to do basic stuff, stuff just to get started, so I thought I'd make a little something. 

Here i'm going to show you how to clone a GitHub repository to a folder on your computer and get all the dependencies. Get all the what?!! 

Dependencies: **A software dependency is an external standalone library that can be as small as a single file or as big as multiple files and folders organized into packages to perform a specific task**

## **Lets get Started**

First, lets download some shit we need to get out of the way.

NPM: [https://nodejs.org/en/download/](https://nodejs.org/en/download/)

Yarn: [https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable)

Git: [https://git-scm.com/downloads](https://git-scm.com/downloads)

Cool, once all that is download, we can really get started.

Next, lets create a folder on our desktop(I use desktop so its easier for me to find, not sharpest tool in the shed) and name it whatever you'd like. I am naming it Test Repo. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbngulc8sld4svhddukj.png)

Go ahead and copy that Folder and open up your terminal to point your directory to that folder by tying CD and pasting the folder path and hitting enter. It'll look like this: (of course it'll be your own path on your comp, so it won't have my name and shit).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bgw0spf5pifg34511d6.png)

Okay cool, now that we have our Terminal in the right directory we need to download the repo. Let's go download it. You can use any repo you'd like to get, but i'll give this link for now to test it all out.

[https://github.com/coreyman11/oyster-swap.git](https://github.com/coreyman11/oyster-swap.git)

When you go to the link, you'll see something like the next screenshot. In the right corner, you'll see a button that says Code in green(1). Once you click the down drop menu, you'll then see a URL with a button next to it(2). Go ahead and click that button.(this copies the Git Repo URL to clone via HTTPS)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/574govoxv9om3f6na9rx.png)

Now, let's go back to our Terminal window and type some stuff in. Once in Terminal type in the command: 

```
Git Clone <Repository URL>
```

In this case I'm using the test URL so it will be 

```
Git Clone https://github.com/coreyman11/oyster-swap.git
```

Hit enter and it will download the Repo into the folder we made on the Desktop!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msf2h97n513x2hbercd6.png)

Okay cool, now we need to download the Dependencies!!!

Let's go into the folder we made on our desktop. You'll notice there is a new folder there named Oyster-swap(well if you downloaded a different repo it'll be something different). Go ahead and copy that with command C on Mac and go back into your terminal window.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qkae2wkhj8bkxcd8dkz4.png)

Once we are in the terminal window, we need to get in that oyster swap folder, so we will do the CD command again. 

```
Cd /Users/coreystevens/Desktop/Test\ Repo/oyster-swap
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7besztlute37y25gr9j.png)

The next command we are going to type into the terminal will download the dependencies. 

```
Yarn install
```
This may take some time, but you should see a window like this once done: (If you have an error due to permission issues use this: Sudo yarn install.)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9o3adi1fmv7en1euwmw.png)

And that's it!! If you go into the file, you'll see we downloaded all the node_modules need(which were the dependencies). 

Good shit, you just downloaded a Github Repo to your comp. 

Next tutorial ill show you how to fork the repo to make your own copy of it and push the data onto the repo!!