Step-by-step guide
🐙 GitHub Copilot
GitHub
📘 Step-by-step guide 📘 GitHub · GitHub Copilotbeginner 💼 Business

Getting started with GitHub Copilot: a beginner's guide

Learn how to let AI write code for you safely, right inside your editor, so you can finish small projects faster.

Hook: By the end of this guide you’ll have GitHub Copilot installed and typing real code for you inside Visual Studio Code. You’ll try it on a tiny “hello world” file so you can see the magic without risk. Perfect for anyone who needs to write code but isn’t a full-time developer.

✅ Before you start
  • A free GitHub account (sign-up takes 30 seconds).
  • A free Microsoft (or GitHub) account.
  • Visual Studio Code installed on your computer.
1

Install the Copilot extension

Open VS Code, click the square icon on the left (Extensions), type “Copilot” and pick the one called GitHub Copilot. Click Install. When it finishes, you’ll see a new Copilot icon in the Activity bar.

💬 Try typing thisIf you don’t see the Extensions view, press `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (Mac) and search for “Copilot”.
2

Sign in with your GitHub account

Click the Copilot icon in the Activity bar, then click “Sign in to GitHub”. A browser window opens; sign in with the same account you used to create your GitHub account. When you see “Copilot is ready,” close the browser and return to VS Code.

💬 Try typing thisIf the sign-in window stays blank, make sure your browser isn’t blocking pop-ups for this site.
3

Turn on the AI helper

In VS Code, open any folder or just create a new empty folder. Inside that folder create a file named hello.py. VS Code will ask if you want to install recommended extensions; say Yes.

💬 Try typing thisCreate the file by right-clicking the folder → New File → name it `hello.py`.
4

Ask Copilot to write your first line

With hello.py open, type the single line:

# write a function that prints hello world

Press Enter. After a second you’ll see grey ghost text appear right after your cursor. That’s Copilot suggesting code. Press Tab to accept it, then press F5 to run the file. You should see “Hello, world!” in the terminal.

💬 Try typing thisIf the ghost text doesn’t appear, check the bottom bar of VS Code for a small Copilot icon with a spinning circle; wait a few seconds and try typing again.
5

Ask for a tiny project

Create a new file called greet.py and type:

# create a function that greets a person by name

Accept the suggestion, then add one more line under it:

greet("Alex")

Save the file and run it. You now have a working mini-program that didn’t require you to write most of the code yourself.

⚠️ Common mistakes
  • Signing in with the wrong account: Copilot only works if you use the same account you used to buy or enable Copilot.
  • Blocking pop-ups: If the sign-in window never appears, check your browser’s pop-up blocker.
  • Waiting too long: If Copilot feels slow, close other apps; it uses a bit of internet bandwidth.
  • Accepting bad suggestions: Always read the ghost text before you press Tab; you can delete it and try again.
🚀 Try it now

Open VS Code, create a file called test.py, type # create a function that adds two numbers, accept the suggestion, and run it. You just wrote—and ran—your first AI-assisted code in under two minutes.

✦ Original step-by-step guide by AI World Co.'s AI editorial team. Written in plain language, reviewed for accuracy.

← Back to all stories