

Windows: From RStudio, under the Tools menu, open Global Options. Then, under the RStudio menu (top of the screen), open Preferences. Mac: First, from the Terminal in RStudio (in the same part of RStudio as the R Console), type which git to get the path to git. If you haven’t restarted RStudio since installing git, do that first. This is optional, but if you’re taking a workshop with us on using git and R, we will use this package to set up authentication to GitHub. Download and install the latest version of RStudio Desktop (free) – this will install it or update your previous installation. The version of RStudio does matter, as it is what is providing the interface for using git. Make sure you have an updated version of RStudio

However, if the first or second number in the version will change (R 4.0 to 4.1 for example), you will need to reinstall all of your packages. If you aren’t using R version 4.0 or later, it’s probably time to update anyway, but it’s not required. The version of R will not affect git, but RStudio requires R 3.3 or later and the usethis package that provides some utility functions for working with git repositories requires R 3.4 or later. Install git using the appropriate package manager for your Linux distribution. You may need to install homebrew first (instructions for that are provided).Īfter you’ve installed git, try git -version in the Terminal again to make sure it is installed. Follow these instructions to install git via Homebrew, which is a program to manage software installations like this on a Mac. If you do not have git installed, or it is before version 2.17, you will want to install git. To check, open the Terminal (Applications > Utilities > Terminal) and type git -version If it is installed, you will see the version number otherwise you will get an error. Git may already be installed on your Mac. When you are done, you should see three “Git” programs installed. If you do not regularly use the command line, you may want to change the default editor to Notepad or another text editor that you are familiar with. Keep the default option, except perhaps for the editor. During installation, you will be asked a series of questions.

If you don’t have it, download and install git. Git shows up as an application in Windows. If you do have an account, make sure you know your username, password, and the associated email address. If you don’t already have one, create a GitHub account. In particular, current versions of RStudio require up to date operating systems. Note: if you are not using a current operating system (Windows 10 or Mac OSX 12) you may run into installation problems. Northwestern researchers can get help via our free consultation service. There are a lot of things that can go wrong along the way. To use git and GitHub with R/RStudio, you first need to set up all of the components.
