6.6 Checking out a project from a version control remote repository

Hopefully it has been a joy configuring your Git setup on your computer. Now we will put all of that machinery to work and test it out. Picking up were we left off when Setting up a remote repository copy the HTTPS clone URL to your clipboard via the green “Clone or Download” button.

6.6.1 Clone the new GitHub repository to your computer via RStudio

In RStudio, start a new Project review here:

  • File > New Project > Version Control > Git. In “Repository URL,” paste the URL of your new GitHub repository. It will be something like this https://github.com/j-p-courneya/T32_Session3_Practice.git.

    • Do you NOT see an option to get the Project from Version Control? Restart RStudio and try again. Still no luck? Go to gitwithr chapter 13 for tips on how to help RStudio find Git.
  • Accept the default project directory name, e.g. T32_Session3_Practice, which coincides with the GitHub repo name.

  • Take charge of – or at least notice! – where the Project will be saved locally. A common rookie mistake is to have no idea where you are saving files or what your working directory is. Pay attention. Be intentional. Personally, I would do this in ~/Documents.

  • I suggest you check “Open in new session,” as that’s what you’ll usually do in real life.

  • Click “Create Project.”

You should find yourself in a new local RStudio Project that represents the new test repo we just created on GitHub. This should download the README.md file from GitHub. Look in RStudio’s file browser pane for the README.md file.