Setting up Git/GitHub to work with R/RStudio can be challenging.
Here's a thread to walk you through the process step by step.
This thread also lives in blog post form. #rstats
Preamble: the best overall resource, and one I rely on extensively, is Happy Git with R by @JennyBryan and @jimhester_.
If you have additional questions about Git/GitHub + R/RStudio, this should be your first
The first step to set things up is to install Git.
Chapter 6 of Happy Git with R lays out the process for Mac, Windows, and Linux users.
I’m on a Mac so Git came pre-installed on my computer. I was able to verify that I had Git installed using the terminal in RStudio.
The next step is to configure Git.
This is covered in Chapter 7 of Happy Git with R , though I show what I believe to be a slightly easier process using the edit_git_config() function from the {usethis} package.