Cloning Your First Repo

When there's an existing repository on Github, in order to work on the code, we must first copy it to our local machine. To do that, we use the git clone command which allows us to copy a repo from a remote server. In our case, the remote server will be Github.

Before continuing, you may have to authenticate git with Github through SSH. You can learn more on how to do this in my article Setting Up SSH Through Github.

To clone, we'll first need the repository's git url. This can be found in the Github UI and copied by clicking the copy button aside it. It will looking something like git@github.com:drewrodrigues/pretend-repo.git.

Once we have the Github url, we can use it in the clone command as follows:

git clone git@github.com:drewrodrigues/pretend-repo.git

After the clone (download) finishes, you can run ls and you'll see your repo in your current directory. Nice!