How to Set Up GitHub Copilot in VS Code
Install one extension, sign in with GitHub, and start getting code suggestions in minutes. This guide shows every step in plain words.
In short: install VS Code, add the GitHub Copilot extension, sign in with a GitHub account that has a Copilot plan, and use Tab, chat and agent mode.
Why Copilot in VS Code
VS Code is free and the most used editor. GitHub Copilot is the most popular assistant for it. Together they give inline suggestions, a chat panel, and an agent that can edit files — a great first setup for any student.
What you need
- VS Code (free, from code.visualstudio.com).
- A GitHub account (free to make).
- A Copilot plan: there is a free tier with monthly limits, plus Pro/Business/Enterprise. Confirm current limits on github.com.
The whole setup, top to bottom
Step-by-step setup
- Install VS Code and open it.
- Open Extensions with Ctrl+Shift+X (Mac: Cmd+Shift+X).
- Search "GitHub Copilot" and click Install. (Copilot Chat is included.)
- Sign in: a prompt appears — click Sign in to GitHub, approve in the browser, come back to VS Code.
- Check the status icon in the bottom bar. If it shows Copilot is active, you are ready.
Copilot Free vs Paid (check current limits)
How to use it
- Inline: start typing or write a comment like
# read a CSV and print the first 5 rows. Grey ghost code appears — press Tab to accept, or Esc to reject. - See more options: press Ctrl+Enter to open a panel of alternative suggestions.
- Chat: press Ctrl+Alt+I (Mac: Cmd+Alt+I) or click the chat icon. Ask "explain this file" or "write a test for this function".
- Inline chat: press Ctrl+I inside the editor to ask about the selected code right there.
- Agent mode: in the chat panel switch to Agent, give a goal, and approve its file edits and commands.
First test (try it now)
- Make a file
hello.py. - Type the comment:
# function that returns the average of a list of numbersand press Enter. - Accept the suggestion with Tab, then run it and check the result.
Safety
- Do not paste secrets or real customer data into chat.
- Turn on duplication detection in settings if your org needs it.
- For private code that must stay offline, use a local model instead (Ollama + Continue).
Quick quiz
1. Which key accepts an inline suggestion?
Tab (Esc rejects it).
2. How do you open Copilot chat?
Ctrl+Alt+I (Mac: Cmd+Alt+I), or click the chat icon.
3. What do you need besides VS Code?
A GitHub account with a Copilot plan (free tier or paid).
4. What does agent mode do?
Edits several files and can run commands, with your approval.
Save tokens and money
The free tier has monthly limits — use inline mode for small tasks and save chat for real problems. Ask short, clear questions. See more AI Coding guides.