Most GitHub Copilot guides stop at the gray “ghost text” in your editor. That’s maybe a third of the job. This GitHub Copilot tutorial goes from a blank VS Code window to a real pull request on GitHub: install, sign in, get your first suggestion, use chat, set project rules, and ship the change for review.
Plan names, prices and limits below come from GitHub’s own docs, checked on November 16, 2026. Copilot changed its billing this year, so a lot of older tutorials quote numbers that no longer exist.
Quick answer: Open VS Code, click the Copilot icon in the Status Bar, choose “Use AI Features” and sign in with GitHub. Without a paid plan you land on Copilot Free (2,000 completions a month). Write a comment, press Tab to accept the suggestion, use Chat for bigger edits, then commit on a branch and open a pull request.
- Copilot Free is $0, Pro is $10 a month, Pro+ $39, Max $100 (GitHub plans page).
- Agent mode in the editor works on Free. The cloud agent that opens pull requests for you needs a paid plan.
- A
.github/copilot-instructions.mdfile gives Copilot your project rules once, instead of in every prompt. - Copilot’s code still needs your review. Our own test below shows why.
What you need first
Three things: a GitHub account, an editor, and Git installed on your machine. This guide uses VS Code because it’s free and it’s where GitHub’s own docs start. Copilot also runs in Visual Studio, JetBrains IDEs such as IntelliJ IDEA and PyCharm, Eclipse, Xcode and the terminal, so the ideas carry over if you use something else.
You don’t need to pay anything to follow along until step 7. Here’s what each individual plan costs, from the Copilot plans page:
| Plan | Price | AI credits a month | Cloud agent |
|---|---|---|---|
| Copilot Free | $0 | “An allowance” (no number given), 2,000 completions | No |
| Copilot Student | Free for verified students | An allowance | Yes |
| Copilot Pro | $10/month | 1,500 (1,000 base + 500 flex) | Yes |
| Copilot Pro+ | $39/month | 7,000 | Yes |
| Copilot Max | $100/month | 20,000 | Yes |
One AI credit is worth $0.01, according to GitHub’s billing docs for individuals. Chat and agent work spend credits. Inline completions don’t, and on paid plans they’re unlimited. Business ($19 per seat) and Enterprise ($39 per seat) exist too, but they’re bought by an organization, not by you.
Verified teachers and maintainers of popular open source projects may get Copilot Pro for free, the plans page says. Worth checking before you pay.

Step 1: Set up GitHub Copilot in VS Code
Install VS Code if you haven’t, then open it. The setup is short:
- Hover over the Copilot icon in the Status Bar at the bottom of the window.
- Pick Use AI Features.
- Choose a sign-in method (GitHub is the obvious one) and finish in the browser.
If your account already has a Copilot plan, VS Code picks it up. If not, signing in puts you on Copilot Free. You can also sign in from the Accounts menu or by running GitHub Copilot: Sign in from the Command Palette (Ctrl+Shift+P on Windows and Linux, Cmd+Shift+P on a Mac).
A privacy note the VS Code docs mention: on the Free plan, telemetry is on by default. Set telemetry.telemetryLevel to off in your settings if you’d rather not share it.
Step 2: Create a practice repository
A pull request needs a repository on GitHub. Create a new public or private repo on github.com, tick “Add a README file” so it isn’t empty, then clone it:
git clone https://github.com/YOUR-USERNAME/copilot-practice.git
cd copilot-practice
code .
The last line opens the folder in VS Code. Keep the project tiny. A small, boring task teaches you how Copilot behaves much faster than “build me a SaaS app” does.
Step 3: Your first inline suggestion
Create a file called slugify.py. Type a comment that describes what you want, press Enter, and wait a second:
# function that turns a blog title into a URL slug:
# lowercase, remove punctuation, spaces become single hyphens
Gray text appears. That’s the suggestion. The keys you’ll use most, per GitHub’s code suggestions guide:
| Action | Windows / Linux | macOS |
|---|---|---|
| Accept suggestion | Tab | Tab |
| Reject | Esc | Esc |
| Next suggestion | Alt+] | Option+] |
| Previous suggestion | Alt+[ | Option+[ |
| Accept one word | Ctrl+Right arrow | Cmd+Right arrow |
Accept word by word when you’re unsure. It forces you to read what you’re taking. Copilot also does “next edit suggestions”: after you change something, an arrow in the gutter points to the next spot that probably needs the same change. Tab jumps there, Tab again accepts it.
Your suggestion will differ from anyone else’s, since the model and your surrounding code shape it. Here’s a typical correct answer, which we ran with Python 3.12 on our machine along with a few tests:
import re
def slugify(title: str) -> str:
slug = title.lower().strip()
slug = re.sub(r"[^a-z0-9\s-]", "", slug)
slug = re.sub(r"[\s-]+", "-", slug)
return slug.strip("-")
print(slugify(" Copilot: 101! ")) # copilot-101
print(slugify("Café au lait")) # caf-au-lait (oops)
All four of our basic tests passed. Then we tried “Café au lait” and got caf-au-lait. The regex quietly deletes the “é”. Nothing crashed, nothing warned us. Hold that thought, because it’s the point of the twist further down.
Step 4: Ask, Plan and Agent in Copilot Chat
Completions handle a few lines. For anything bigger, open the Chat view from the chat icon in the title bar. GitHub’s chat docs for IDEs list three agents in the dropdown at the bottom of the chat box:
- Ask answers questions about your code and doesn’t touch files. Start here with “Explain what slugify does with accented letters.”
- Plan writes out the steps before any change. Good for anything touching more than one file.
- Agent edits files and can run terminal commands, asking for approval as it goes. It’s included on Copilot Free, per the plans page.
For a quick edit without leaving the file, select some code and press Ctrl+I (Cmd+I on a Mac) for inline chat. Try: “Keep accented letters by converting them to plain ASCII first.” Type / in any chat box to see the available commands, # to attach context and @ to call a participant.
Then ask Agent for something testable: “Add a pytest file for slugify that covers empty strings, extra spaces and accented letters, then run it.” Read each command before you approve it. That habit matters more than any prompt trick, and we cover it in our habits for coding faster with AI.
Step 5: Give Copilot your project rules
Tired of typing “use pytest, keep functions short” in every prompt? Put it in a file. GitHub’s custom instructions docs say to create .github/copilot-instructions.md in the root of your repository:
# Project rules
- Python 3.12, standard library only.
- Every new function gets a pytest test in tests/.
- Keep functions under 30 lines. Type hints on all arguments.
- Never edit files in .github/workflows without asking.
Short and specific beats long and vague. You can also add path-specific rules as NAME.instructions.md files under .github/instructions, and Copilot reads AGENTS.md files placed anywhere in the repo. If you also use Claude Code, the idea is the same as its CLAUDE.md, which our Claude Code tutorial for beginners walks through.
Step 6: Open your first pull request
Never push practice work straight to main. Make a branch, commit, push:
git switch -c add-slugify
git add .
git commit
git push -u origin add-slugify
You don’t have to write the commit message yourself. In VS Code’s Source Control view, the sparkle icon in the message box drafts one from your changes, according to the VS Code smart actions docs. Edit it so it says what changed and why. Generated messages tend to describe the “what” and skip the “why”.
Now open the pull request. On github.com, a yellow banner offers “Compare & pull request” right after a push. Or, if you have the GitHub CLI, one line does it:
gh pr create --fill
--fill uses your commit for the title and body (see the gh pr create manual). That’s your first pull request. On Copilot Free, the review side is limited: the plans page lists only “Review selection” in VS Code. On paid plans, you can request Copilot as a reviewer on the pull request itself.
Step 7: Let the cloud agent open the PR (paid plans)
Paid plans get Copilot in the cloud. It researches the repo, makes changes in a cloud environment and opens the pull request without your laptop. The cloud agent guide describes the simplest route:
- Write an issue: “slugify drops accented letters. Convert them to ASCII and add tests.”
- In the issue’s right-hand menu, click Assignees, then Copilot. Add extra guidance in the optional prompt field.
- Copilot works on its own branch, opens a pull request and requests your review.
- Want changes? Comment on the pull request and mention
@copilot.
Two details catch people out. First, Copilot only sees the issue as it was when you assigned it, so new facts go in a PR comment. Second, GitHub Actions workflows don’t run on Copilot’s pushes by default. You check the changes (especially anything in .github/workflows/), then click Approve and run workflows. Per GitHub’s overview of the agent, a session on Actions runs for at most 59 minutes and opens one pull request per task.

Common errors and quick fixes
- No gray suggestions at all. Check the Copilot icon in the Status Bar. You may be signed out, or Free’s 2,000 monthly completions may be used up.
- Suggestions ignore your style. Open the related files in tabs. Copilot uses open files as context, and a rules file helps even more.
- Agent keeps asking for approval. That’s by design. Approving blind is how a wrong
rmor a dependency you didn’t want slips in. - Cloud agent won’t open a PR. A ruleset or branch protection rule can block it, according to GitHub’s limits list, and it only works with repos hosted on GitHub.
- Chat stopped answering. Free has a limited, unnumbered chat allowance. Paid plans can set a budget and keep going.
The part most tutorials skip: the code that looks right and passes your first tests is the dangerous kind. Our slugify passed four tests and still turned “Café” into “caf”. A beginner would merge that. Copilot speeds up writing code, but the pull request is where you slow down: read the diff line by line, add one weird input test, and only then merge. GitHub’s own docs say the agent “can produce incorrect or suboptimal code, including code that contains security vulnerabilities.”
Is GitHub Copilot worth it for beginners?
Start on Free. Completions, inline chat and Agent mode are enough to learn the workflow above, and 2,000 completions a month is plenty for practice projects. Pay $10 for Pro only when you hit the limits or want the cloud agent to work on issues while you do something else.
Skip Copilot if you’re in your first weeks of learning to code and can’t yet tell a good suggestion from a bad one. Type things out by hand for a while. If you already know you want a terminal-first agent instead, compare it properly in our Claude Code vs Codex vs GitHub Copilot breakdown.
Next: once Copilot writes something that breaks, use our step-by-step method for fixing bugs with AI to track it down without guessing.
FAQ
Can I use GitHub Copilot for free?
Yes. Copilot Free costs nothing and includes 2,000 completions a month, Copilot Chat, inline chat and Agent mode in the IDE, with auto model selection only. Verified students get Copilot Student for free.
Can you use GitHub Copilot without GitHub?
You need a GitHub account to sign in, but your code doesn’t have to live on GitHub for completions and chat in the editor. The cloud agent is different: it only works with repositories hosted on GitHub.
Does this GitHub Copilot tutorial work in IntelliJ or Visual Studio?
Mostly. JetBrains IDEs and Visual Studio have their own Copilot plugin and sign-in screens, so the buttons differ, but the flow is the same: completions with Tab, chat, a rules file, then a branch and pull request.
How do I give GitHub Copilot instructions?
Add a .github/copilot-instructions.md file to your repository with short, specific rules. For the cloud agent, put the details in the issue text or the optional prompt when you assign it.