Appendix A — Install Rstudio and git

A.1 Part 1: Install Git

A.1.1 Windows Users

  1. Download Git:
    • Go to https://git-scm.com/download/win
    • The download should start automatically
    • If not, click “Click here to download manually”
  2. Run the Installer:
    • Double-click the downloaded .exe file
    • Recommended settings during installation:
      • Use the default installation directory
      • Select “Git from the command line and also from 3rd-party software”
      • Use the bundled OpenSSH
      • Use the OpenSSL library
      • Checkout Windows-style, commit Unix-style line endings
      • Use MinTTY (default terminal)
      • Default pull behavior: “Default (fast-forward or merge)”
      • Accept all other defaults
  3. Verify Installation:
    • Open Command Prompt (search for “cmd” in Start menu)
    • Type: git --version
    • You should see something like git version 2.x.x

A.1.2 Mac Users

  1. Check if Git is Already Installed:

    • Open Terminal (Applications → Utilities → Terminal, or search for “Terminal”)
    • Type: git --version
    • If you see a version number (e.g., git version 2.x.x), git is already installed - skip to Part 2!
  2. If Git is Not Installed:

    Option A: Command Line Tools (Recommended - faster and smaller)

    • In Terminal, type: xcode-select --install
    • Click “Install” when prompted
    • Agree to the license terms
    • Wait for installation to complete (5-10 minutes)

    Option B: Download from Git Website

    • Go to https://git-scm.com/download/mac
    • Download the installer for your macOS version
    • Open the downloaded .dmg file and follow instructions
  3. Verify Installation:

    • In Terminal, type: git --version
    • You should see something like git version 2.x.x

A.2 Part 2: Install RStudio

A.2.1 All Users (Windows and Mac)

  1. Download RStudio Desktop:
    • Go to https://posit.co/download/rstudio-desktop/
    • Scroll down to “2: Install RStudio”
    • Click the download button for your operating system (Windows or macOS)
  2. Install RStudio:
    • Windows: Double-click the .exe file and follow the installation wizard
    • Mac: Open the .dmg file and drag RStudio to your Applications folder
  3. Launch RStudio:
    • Open RStudio from your Applications folder (Mac) or Start menu (Windows)
    • Wait for it to fully load

A.3 Part 3: Configure Git in RStudio

  1. Open RStudio

  2. Configure Git Settings:

    • Go to Tools → Global Options
    • Click on Git/SVN in the left sidebar
    • Check that the “Git executable” field shows a path
      • Windows example: C:/Program Files/Git/bin/git.exe
      • Mac example: /usr/bin/git or /usr/local/bin/git
    • If the field is empty, click “Browse” and locate git manually
  3. Set Your Git Identity:

    • In RStudio, go to Tools → Terminal → New Terminal
    • Type the following commands (replace with YOUR information):
    git config --global user.name "Your Full Name"
    git config --global user.email "your.email@example.com"
    • Use the @my.UTexas.edu email address (this does not have to be the same as your GitHub email)
  4. Restart RStudio to ensure all settings take effect


A.4 Installation Complete!

You’re now ready for the course. Please complete the verification checklist below to confirm everything is working properly.

A.5 Verification Checklist

A.5.1 Step 1: Check Git Version

A.5.2 Step 2: Verify Git Configuration

In the same command line/terminal window, type each command and verify output:

A.5.3 Step 3: Launch RStudio

A.5.4 Step 4: Check RStudio Version

A.5.5 Step 5: Verify Git Integration in RStudio

A.5.6 Step 6: Test Terminal in RStudio


A.6 ✓ Text Editing Verification

A.6.1 Step 7: Create a Test Script


A.7 🎉 All Checks Complete!

If you checked all boxes above, you’re ready for class!


A.8 ⚠️ Troubleshooting

If Git is not found in RStudio (Step 5):

  1. Restart RStudio completely (quit and reopen)
  2. Re-check Tools → Global Options → Git/SVN
  3. If still empty, click Browse next to “Git executable” and navigate to:
    • Windows: C:\Program Files\Git\bin\git.exe
    • Mac: /usr/bin/git or type which git in Terminal to find the path
  4. Click Browse and select the git executable file
  5. Click OK and restart RStudio

If Git version command doesn’t work (Step 1): - Windows: Git may not be in your system PATH. Try reinstalling Git with default settings. - Mac: You may need to install Command Line Tools. Open Terminal and type xcode-select --install

If system is still having issues: - Note the specific error message or problem - Take a screenshot if possible - Flag down instructor or TA in class. - Contact instructor or TA via Canvas.

If you run into unfixable problems with your install you can use a free account on http://rstudio.cloud.

A.9 Configure Nano as Default Git Editor

When you run git commit without the -m flag, Git opens a text editor for you to write your commit message. By default, this is often vi (or vim), which can be very confusing.

If you find yourself in vi, you might notice:
- A screen with ~ symbols on the left
- Typing doesn’t work as expected
- No obvious way to exit or save

To escape from vi without saving:
1. Press Esc twice (to enter command mode)
2. Type :q!
3. Press Enter

This exits without making a commit.

Switching to nano

Instead of struggling with vi, we recommend configuring nano as your default editor. Nano is much more user-friendly and works like most text editors you’re familiar with.

To configure nano as your default Git editor, run this command once:

git config --global core.editor nano

Using nano:

When Git opens nano for a commit message, you’ll see:

  • Simply type your commit message at the top
  • The bottom shows available commands where ^ means the Ctrl key

To save and exit nano:
1. Press Ctrl + X (shown as ^X Exit at the bottom)
2. Press Y when asked “Save modified buffer?”
3. Press Enter to confirm

A.10 Git Default Branch: Main vs Master

Git’s default branch name has changed over time. Depending on your Git version and when you set up your repository, you may see either main or master as your default branch name. These are functionally identical, just different names for the same thing.

A.10.1 Check Your Default Branch

Check Your Git’s Default Branch Setting

git config --global init.defaultBranch