How to Set Up GitHub Copilot in VS Code

If you’ve ever wished for an AI coding assistant that understands your code and writes it with you, GitHub Copilot is exactly that. Developed by GitHub and OpenAI, Copilot integrates directly into Visual Studio Code (VS Code) to provide intelligent code suggestions, completions, and entire function bodies in real time.

In this post, you’ll learn how to set up GitHub Copilot in VS Code, connect your GitHub account, and start using AI code assistance within minutes.

How to Set Up GitHub Copilot in VS Code

Getting Started

GitHub Copilot is an AI-powered coding assistant developed by GitHub and OpenAI. It helps you write code faster by suggesting entire lines or functions directly in your editor. If you use Visual Studio Code (VS Code), integrating GitHub Copilot is straightforward. Here you’ll learn how to set it up and start using it in just a few minutes.

Before you begin, make sure you have:
  • Visual Studio Code installed (version 1.60 or later)
  • A GitHub account
  • A GitHub Copilot subscription (or a free trial)
  • A stable internet connection

Install Visual Studio Code

If you haven’t installed VS Code in your system yet:
  1. Go to the official Visual Studio Code website.
  2. Download and install the version for your operating system (Windows, macOS, or Linux).
  3. Launch VS Code once the installation is complete.

If you are new and want to know complete steps to Install VS Code, then visit my post "How to Install Visual Studio Code"

Install the GitHub Copilot Extension

To add Copilot to VS Code:
  1. Open VS Code.
  2. Click the Extensions icon on the sidebar or press Ctrl+Shift+X (Cmd+Shift+X on macOS).
  3. In the search bar, type GitHub Copilot.
  4. Find the official extension published by GitHub and click Install.

Sign In to Your GitHub Account

  1. Once the extension is installed.
  2. You’ll be prompted to sign in to GitHub.
  3. Click Sign in, and a browser window will open.
  4. Authorize Visual Studio Code to access your GitHub account.
  5. After authorization, return to VS Code — Copilot should now be linked to your account.

Sign In to Your GitHub Account

  1. Once the extension is installed.
  2. You’ll be prompted to sign in to GitHub.
  3. Click Sign in, and a browser window will open.
  4. Authorize Visual Studio Code to access your GitHub account.
  5. After authorization, return to VS Code — Copilot should now be linked to your account.

Enable GitHub Copilot in VS Code

  1. After logging in.
  2. Open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P.
  3. Type and select “GitHub Copilot: Enable”.
  4. You’ll see the Copilot icon appear in the status bar once it’s active.

Start Using GitHub Copilot

  1. Begin typing code — Copilot will automatically suggest code completions in gray text.
  2. Press Tab or Enter to accept a suggestion.
  3. Use Alt + ] and Alt + [ to cycle through multiple suggestions.
      Example:
      def fibonacci(n):
      

      Copilot might suggest:
      if n <= 1:
      return n
      return fibonacci(n-1) + fibonacci(n-2)
      

Customize GitHub Copilot Settings

You can personalize Copilot’s behavior to suit your workflow:
  1. Go to Settings (Ctrl+, or Cmd+,).
  2. Search for Copilot.
  3. Modify preferences such as:
    • Enabling/disabling Copilot for specific languages
    • Managing automatic suggestions
    • Controlling telemetry and data usage

Troubleshooting GitHub Copilot in VS Code

  1. If something doesn’t work as expected, try these fixes.
  2. Extension won’t activate: Ensure you’re signed in with an active GitHub Copilot subscription.
  3. No code suggestions: Check your internet connection or restart VS Code.
  4. Conflicts: Disable other autocomplete or AI extensions temporarily.

Summary

Setting up GitHub Copilot in VS Code is quick and easy. Once it’s running, it can significantly boost your productivity. Whether you’re a beginner learning a new language or an experienced developer tackling complex logic, Copilot can help you code faster, smarter, and with fewer errors.

Thanks

Kailash Chandra Behera

I am an IT professional with over 13 years of experience in the full software development life cycle for Windows, services, and web-based applications using Microsoft .NET technologies.

Previous Post Next Post

نموذج الاتصال