Getting Started with GitHub Copilot
Last updated on 2025-12-15 | Edit this page
Estimated time: 30 minutes
Overview
Questions
- How do I register for a GitHub account?
- How can I get free GitHub Copilot access as a student?
- How do I set up GitHub Copilot in RStudio?
Objectives
- Create a GitHub account
- Apply for GitHub Student Developer Pack
- Install and configure GitHub Copilot in RStudio
- Verify GitHub Copilot is working as an autocompletion tool
Introduction
GitHub Copilot is an AI-powered code completion tool that can significantly enhance your coding experience in RStudio. This chapter will guide you through the process of setting up GitHub Copilot, from creating a GitHub account to configuring it in RStudio.
Registering with GitHub
If you don’t already have a GitHub account, follow these steps:
- Navigate to github.com
- Click the “Sign up” button in the top right corner
- Enter your email address (preferably your university/institutional email)
- Create a strong password
- Choose a username
- Verify your account through the email confirmation
Requesting GitHub Student Developer Pack
As of November 2025, GitHub offers free access to GitHub Copilot and other premium features to students through the GitHub Student Developer Pack.
Steps to Apply
- Go to education.github.com/pack
- Click on “Sign up for Student Developer Pack”
- Sign in with your GitHub account if not already logged in
- Fill out the application form:
- Select your school from the dropdown (or enter it manually)
- Provide your school-issued email address
- Describe how you plan to use GitHub (e.g., “For coursework and research projects”)
- Upload proof of enrollment:
- Student ID card
- Official enrollment letter
- Transcript or other academic document
- Submit your application
Application Processing Time
GitHub typically processes student applications within a few days, but it can take up to 2 weeks. You’ll receive an email notification once your application is approved.
Installing GitHub Copilot in RStudio
Once your GitHub Student Developer Pack is approved, you can set up GitHub Copilot in RStudio.
Installation Steps
-
Install the GitHub Copilot extension in RStudio:
- Open RStudio
- Go to
Tools→Global Options - Select
Copilotfrom the left sidebar - Click “Enable GitHub Copilot”
- If the Copilot option is not available, make sure you’re running RStudio 2022.02 or later
-
Sign in to GitHub:
- Click “Sign in to GitHub” in the Copilot settings
- A browser window will open asking you to authorize RStudio
- Click “Authorize” to grant RStudio access to your GitHub account
- You may be asked to enter a device code - copy the code shown in RStudio and paste it into the browser
-
Verify the connection:
- Return to RStudio
- You should see a confirmation that GitHub Copilot is enabled
- The status should show “GitHub Copilot: Active”
Challenge 1: Test GitHub Copilot
Open a new R script in RStudio and try typing a comment describing a function, such as:
R
# Function to calculate the mean of a numeric vector
Does GitHub Copilot suggest a function implementation?
GitHub Copilot should suggest a function implementation below your comment. The suggestion might look something like:
R
# Function to calculate the mean of a numeric vector
calculate_mean <- function(x) {
sum(x) / length(x)
}
You can accept the suggestion by pressing Tab or
continue typing to see alternative suggestions.
Tips for Using Copilot
- Write clear, descriptive comments to get better suggestions
- Review all suggestions before accepting them
- Use Tab to accept a suggestion, or Esc to dismiss it
- Copilot learns from context, so well-structured code gets better suggestions
Configuring Copilot Settings
You can customize how GitHub Copilot works in RStudio:
- Go to
Tools→Global Options→Copilot - Adjust settings such as:
- Enable/Disable Copilot: Toggle Copilot on or off
- Suggestion mode: Configure how suggestions appear
- Keybindings: Customize keyboard shortcuts for accepting suggestions
Recommendation
For this course, we recommend to
disable “Index project files with GitHub Copilot”
- to speed up performance
- to reduce traffic
- to keep private code private
- to reduce unwanted suggestions from your existing codebase.
Troubleshooting Common Issues
Github Education Programm Registration fails
Check the security settings of your browser!
- Github (and thus the browser) want to check your location to verify your student status
- This check is sometimes blocked by strict privacy settings
- Try a different browser or adjust (temporarily) your privacy settings
Copilot is not showing suggestions
- Verify that Copilot is enabled in settings
- Check that you’re signed in to GitHub
- Check your internet connection
- Ensure your GitHub Copilot subscription is active
- Try restarting RStudio
Authorization fails
- Clear your browser cache and try again
- Make sure you’re using the correct GitHub account
- Check that your GitHub Copilot access is active
It’s all not working !!!
- Give us a ring! We are happy to help you to get started.
- A GitHub account is required to use GitHub Copilot
- Students can get free GitHub Copilot access through the GitHub Student Developer Pack
- GitHub Copilot integrates directly into RStudio as an autocompletion tool
- Test Copilot by writing descriptive comments and observing the suggestions
- Copilot can be customized through RStudio’s settings