How to Set Up GitHub Copilot in Under 30 Minutes for Your First Project
How to Set Up GitHub Copilot in Under 30 Minutes for Your First Project
If you're a developer looking to boost your productivity, GitHub Copilot is an AI-powered coding assistant that can help you write code faster and with fewer errors. But setting it up for your first project can feel daunting, especially if you're short on time. The good news? You can get GitHub Copilot up and running in under 30 minutes. Here’s how.
Prerequisites: What You Need Before Starting
Before diving into the setup process, make sure you have the following:
- GitHub Account: You need an active GitHub account to use Copilot. If you don’t have one, sign up at GitHub.com.
- Visual Studio Code (VS Code): Download and install Visual Studio Code, as Copilot is integrated into this popular code editor.
- GitHub Copilot Subscription: GitHub Copilot costs $10/month after a free trial. Make sure you’re ready to subscribe if you want to keep using it after the trial period.
Step 1: Install Visual Studio Code
First things first, if you haven’t already installed Visual Studio Code, do it now. Here’s how:
- Go to the Visual Studio Code download page.
- Download the version suitable for your operating system (Windows, macOS, or Linux).
- Follow the installation instructions.
Expected Output: You should have VS Code ready to go, looking something like this:

Step 2: Install GitHub Copilot Extension
Now that you have VS Code installed, it’s time to get Copilot set up:
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
- Search for "GitHub Copilot" in the Extensions Marketplace.
- Click the “Install” button next to the GitHub Copilot extension.
Expected Output: The Copilot icon should appear in your VS Code sidebar.
Step 3: Sign In to GitHub
After installing the extension, you need to sign in to your GitHub account:
- Click on the GitHub Copilot icon.
- A prompt will appear to sign in. Click on “Sign in” and follow the authentication process.
- Authorize the GitHub Copilot extension to access your account.
Expected Output: You should see a confirmation message indicating that you’re signed in.
Step 4: Start a New Project
Now that Copilot is installed and configured, let’s create a new project:
- Open a new terminal in VS Code (Terminal > New Terminal).
- Create a new directory for your project with
mkdir my-github-copilot-projectand navigate into it usingcd my-github-copilot-project. - Initialize a new Git repository with
git init. - Create a new file (e.g.,
index.js) where you’ll write your code.
Expected Output: You should have a new directory with a Git repository and an empty file ready for coding.
Step 5: Start Coding with GitHub Copilot
You're ready to start using GitHub Copilot! Begin typing in your file, and Copilot will suggest code snippets as you go. For example:
- Type a comment like
// Function to add two numbersand hit enter. - Copilot will suggest a function. You can accept the suggestion by pressing
Tab.
Expected Output: A complete function is generated in your file, saving you time on boilerplate code.
Troubleshooting: What Could Go Wrong
- Copilot Suggestions Not Appearing: Ensure you’re signed in to GitHub and that the Copilot extension is enabled.
- Slow Suggestions: If suggestions take too long, try restarting VS Code or check your internet connection.
What’s Next?
After setting up GitHub Copilot, consider experimenting with different programming languages and frameworks. You can also explore how Copilot can assist you in various coding tasks, from writing comments to generating complex algorithms.
For more advanced usage, look into integrating Copilot with other tools in your stack, or check out the Built This Week podcast for insights on how we use GitHub Copilot and other AI coding tools.
Conclusion: Start Here
Setting up GitHub Copilot in under 30 minutes is straightforward. With just a GitHub account, Visual Studio Code, and a subscription, you can leverage AI to enhance your coding productivity. If you’re still unsure about using it, take advantage of the free trial and see how it fits into your workflow.
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.