Skip to main content

Quickstart for GitHub Copilot

Quickly learn how to use Copilot to suggest code as you type.

Introduction

This guide demonstrates how to set up a GitHub Copilot Individual subscription for your personal account, set up GitHub Copilot in Visual Studio Code, and get your first code suggestion.

To learn more about everything that Copilot can do, see "About GitHub Copilot."

To get started using Copilot in other coding environments, see "Using GitHub Copilot code suggestions in your editor."

Sign up for GitHub Copilot

Start a free trial

Before you can start using GitHub Copilot through your personal account, you will need to set up a free trial or subscription for GitHub Copilot Individual. For more information, see "About GitHub Copilot Individual."

Install Visual Studio Code and the GitHub Copilot extension

  1. If you don't already have Visual Studio Code installed, install it from the Visual Studio Code download page.

  2. Install the GitHub Copilot extension from the Visual Studio Marketplace. For more information, see "Set up GitHub Copilot in Visual Studio Code" in the Microsoft documentation.

Get your first suggestion

Now that you've installed the GitHub Copilot extension, follow these steps to create a new file and get a code suggestion from Copilot.

This example uses JavaScript, however other languages will work similarly. GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++. GitHub Copilot can also assist in query generation for databases, or generating suggestions for APIs and frameworks.

  1. Open Visual Studio Code.

  2. In Visual Studio Code, create a new JavaScript (*.js) file.

  3. In the JavaScript file, type the following function header.

    JavaScript
    function calculateDaysBetweenDates(begin, end) {
    

    GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.

  4. To accept the suggestion, press Tab.

Next steps

You successfully installed GitHub Copilot and received your first suggestion, but that's just the beginning! Here are some helpful resources for taking your next steps with GitHub Copilot.