Copy the git URL

Our next big goal is to get the code from Github into our RStudio. But, this takes a couple steps. The first one is to copy the URL to your repository.

Click the “Clone or Download” button, and then copy the URL there. Make sure it says “Clone with HTTPS” at the top.

Copy URL

Copy URL

Make new RStudio Project

Go to your rstudio.cloud, and within our STAT360 workspace, click the dropdown next to New Project and selct “New Project from Git Repo”

Make new RStudio project

Make new RStudio project

In the pop-up window, paste the URL of the git repostory that you copied in the previous step

Paste URL

Paste URL

RStudio will ask you to enter your Github username and password. Enter those, and be patient as RStudio generates a new project.

Enter Github credentials

Enter Github credentials

Don’t try to edit the name of the project yet, as that will make the import from Github fail. Another way it fails is if you enter your Github username and/or password incorrectly. This is a fragile point in the process! If it doesn’t work, go back to the STAT360 workspace and try making a new project again.

Introduce yourself to git

Perhaps the most annoying part of this process is that you have to (re)introduce yourself to git every time you make a new project. I asked RStudio, and that’s really what you have to do.

To introduce yourself to git, open the Terminal (the tab next to the Console)

Introduce yourself to git

Introduce yourself to git

In that window, type each of these statements, one at a time, and then hit Enter.

git config --global user.name 'Jane Doe'

git config --global user.email 'jane@example.com'

git config --global credential.helper 'cache --timeout 3600'

git config --global --list

Remember to write your name where it says Jane Doe, and your email address where it says jane@example.com. The cache timeout stuff will make RStudio remember your Github username/password for an hour.