git
git is a version control software. With it, you can download repositories, track your changes and develop code collaboratively.
install git
This can be tedious, but needs to be done only once.
If not already done before: create a github account at https://github.com/signup. Use a short username!
Download and install git, see https://git-scm.com/downloads
Restart Rstudio (if open)
Connect git to Rstudio: (instructions with screenshots)
- RStudio -> Tools -> Global Options -> Git/SVN: Ensure the path to the Git executable is correct.
Create SSH Key, close windowView public key: copy the displayed public key- go to https://github.com/settings/keys and click
New SSH key, paste the public key - in the RStudio bottom Tab
Terminal: type the following:
git version # just to see git works fine git config --global user.email "YourEmail@domain.com" git config --global user.name "YourUserNameHere"
use git
To clone a git repo, Rstudio handles most the work for you.
- Go to a repo (for example github.com/brry/fpsetup) and click on Code - Copy URL
- At Rstudio - File - New Project - Version Control - Git,
paste the repository URL, set the subdirectory and create project.
I recommend to keep the Project directory name so local and github folder names match exactly.
- At Rstudio - File - New Project - Version Control - Git,

- From now on, get the latest version with a single click on
Pull:
- From now on, get the latest version with a single click on
git resources
Happy Git with R: https://happygitwithr.com
Excellent tutorial on git in general (mostly without Rstudio): http://kbroman.org/github_tutorial
HPI course: https://open.hpi.de/courses/git2020
Contribute to OS software: https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github