Skip to main content

Installing and Configuring GitHub Copilot

1. Installing Copilot Extension in VS Code

To install the GitHub Copilot extension in Visual Studio Code:

  1. Open VS Code.
  2. Navigate to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or pressing Ctrl+Shift+X.
  3. In the Extensions search bar, type GitHub Copilot.
  4. Select the official GitHub Copilot extension by GitHub.
  5. Click the Install button.

After installation, you will be prompted to sign in with your GitHub account. Once signed in, Copilot will be ready to use.

Example: Enabling Copilot in VS Code

gh copilot setup
Step Description Result
Install Extension Search and install the GitHub Copilot extension from the VS Code Marketplace. Copilot is now available in your editor.
Sign In Sign in with your GitHub account to activate Copilot features. Access to AI-assisted code suggestions and completions.

2. Installing Copilot in JetBrains IDEs

GitHub Copilot is available as a plugin for JetBrains IDEs such as IntelliJ IDEA, PyCharm, WebStorm, and others. Follow these steps to install the plugin:

Step Description Action
1 Open your JetBrains IDE Ensure the IDE is running and you have access to its plugin manager.
2 Access Plugin Manager Go to File > Settings > Plugins (or Preferences > Plugins on macOS).
3 Search for Copilot In the search bar, type Copilot to find the official GitHub Copilot plugin.
4 Install Plugin Click Install and confirm the installation.
5 Restart IDE Restart your IDE to activate the plugin.

Example: Enabling Copilot in IntelliJ IDEA

File > Settings > Plugins > Search: Copilot > Install > Restart
Note: You must be logged into a GitHub account with an active Copilot subscription to use the plugin.
Warning: Some JetBrains IDEs may require a specific version of the IDE to support Copilot. Ensure your version is compatible.

3. Signing In with a GitHub Account

Example: GitHub Copilot Login Flow

// GitHub Copilot login via IDE
const copilot = {
  auth: {
    provider: "github",
    token: "ghu_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    user: {
      login: "john_doe",
      email: "john.doe@example.com"
    }
  },
  status: "authenticated"
};

console.log("Copilot authenticated with GitHub account:", copilot.auth.user.login);
Step Action Description
1 Open IDE Launch your preferred IDE (VS Code, JetBrains, etc.)
2 Access Copilot Panel Navigate to GitHub Copilot panel or command palette
3 Sign In Select "Sign in with GitHub" option
4 Authorize Access Grant Copilot access to your GitHub account
5 Confirm Authentication Verify session in Copilot dashboard
Note: Your GitHub account must have read:org permissions to access organization repositories.
Warning: Copilot requires a valid GitHub account with active subscription to function properly.

Authentication Requirements

  • GitHub Account: Must be verified and active
  • Permissions: read:org, repo
  • Subscription: GitHub Copilot subscription required
  • IDE Support: Supported IDEs must be installed

4. Activating Copilot Individual Plan

Example: Activating Copilot on GitHub

# Step 1: Navigate to GitHub Copilot settings
# Visit https://github.com/settings/copilot

# Step 2: Select "Individual" plan
# Click on "Switch to Individual Plan"

# Step 3: Confirm activation
# Review and confirm your plan selection
Step Action Description
1 Visit GitHub Copilot settings Navigate to GitHub Copilot settings
2 Select Individual Plan Click "Switch to Individual Plan" if not already selected
3 Confirm Activation Review and confirm your plan selection to activate Copilot
Note: The Individual Plan includes access to Copilot for personal use with a monthly subscription fee.
Warning: Ensure you are logged into the correct GitHub account before activating the plan.

5. Activating Copilot Business Plan

Step Description Action Required
1 Log into your GitHub account with Business plan access Sign in to https://github.com
2 Navigate to Copilot settings page Go to https://github.com/settings/copilot
3 Enable Copilot for your organization Select Enable Copilot for this organization
4 Configure team access settings Set permissions for teams and users
5 Verify Copilot is active Check Active status in settings panel

Example: Enabling Copilot via GitHub UI

1. Visit: https://github.com/settings/copilot
2. Click "Enable Copilot for this organization"
3. Select teams to grant access
4. Confirm activation in dashboard
Note: Business plan activation requires an organization admin role.
Warning: Copilot must be enabled at the organization level before individual users can access it.
Feature Status Availability
Code suggestions ACTIVE Full
Chat support ACTIVE Full
Team collaboration ACTIVE Full
Usage analytics ACTIVE Full

6. Activating Copilot Enterprise Plan

Step Description Action
1 Ensure you have an organization with Copilot Enterprise license Log into GitHub Enterprise and navigate to the organization settings
2 Access Copilot Enterprise dashboard Go to https://github.com/organizations/<org-name>/copilot
3 Enable Copilot for the organization Click "Enable Copilot" in the dashboard
4 Assign seats to users Navigate to "Seats" and assign licenses to team members

Example: Enabling Copilot via API

const enableCopilot = async () => {
  const response = await fetch(
    'https://api.github.com/enterprises/<enterprise-name>/copilot/billing',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer <token>',
        'Accept': 'application/vnd.github.v3+json'
      },
      body: JSON.stringify({
        plan: 'enterprise',
        seats: 50
      })
    }
  );
  const result = await response.json();
  console.log('Copilot enabled:', result);
};
Note: Copilot Enterprise requires a GitHub Enterprise license and is available for organizations with 50+ seats.

7. Configuring Copilot Settings

Setting Description Default Value Notes
copilot.enable Enables or disables Copilot true Set to false to disable Copilot entirely
copilot.autoTrigger Enables automatic triggering of suggestions true Disabling may require manual trigger via shortcut
copilot.suggestWhitelist Lists file extensions to enable Copilot suggestions ["*.js", "*.ts", "*.jsx", "*.tsx", "*.py", "*.java"] Customize to include or exclude specific file types
copilot.suggestBlacklist Lists file extensions to disable Copilot suggestions ["*.min.js"] Overrides whitelist; useful for excluding minified files
copilot.inlineSuggestion Enables inline suggestions in the editor true Can be disabled to show suggestions in a separate panel
copilot.suggestionTimeout Timeout in milliseconds for suggestion fetching 5000 Adjust for slower network connections or performance tuning

Example: Copilot Settings Configuration

{
  "copilot.enable": true,
  "copilot.autoTrigger": false,
  "copilot.suggestWhitelist": [
    "*.js",
    "*.ts"
  ],
  "copilot.suggestionTimeout": 10000
}
Note: Copilot settings can be configured in the IDE's settings or via a copilot.json file in the project root.
Warning: Modifying copilot.suggestWhitelist or copilot.suggestBlacklist may affect Copilot's performance in large projects with many file types.

8. Selecting Copilot Model Backend

Backend Description Notes
github/copilot Default model provided by GitHub Copilot Includes support for multiple programming languages and is updated regularly
openai/gpt-4 Powered by OpenAI's GPT-4 model Highly accurate and capable of understanding complex code logic
anthropic/claude-3 Powered by Anthropic's Claude 3 model Strong in reasoning and code generation with better safety features
google/gemini-pro Powered by Google's Gemini Pro model Good performance in code completion and natural language understanding

Example: Setting Copilot Model Backend

// Example configuration in VS Code settings.json
{
  "github.copilot.model": "openai/gpt-4"
}
Note: The selected backend model affects the accuracy and performance of code suggestions. Ensure that your environment has access to the required API keys or model endpoints.

9. Managing Copilot Seat Licenses

License Type Description Eligibility Notes
Individual Personal license for individual use Single developer Includes access to all Copilot features
Team License for team or organization use Up to 100 developers Requires GitHub Enterprise or GitHub Advanced Security
Enterprise License for enterprise-level organizations Unlimited developers Includes advanced admin controls and support

Example: Assigning a Copilot License to a User

gh copilot license assign --user john.doe@example.com --license-type team
Note: License assignments can be managed via the GitHub CLI or through the GitHub Admin Console.
Warning: Removing a license from a user will revoke their access to Copilot features immediately.
License Status Impact Action Required
Active User has full Copilot access None
Inactive User cannot use Copilot features Reassign or renew license
Expired User loses access to Copilot features Renew or reassign license

Managing Copilot Licenses Summary

  • Assign licenses via GitHub CLI or Admin Console
  • Manage seat allocation by user or team
  • Monitor license status to prevent access issues

10. Troubleshooting Copilot Sign-In Issues

Issue Symptoms Resolution Steps
Authentication Failure Sign-in fails with error: "Authentication failed"
  1. Verify GitHub account credentials
  2. Reinstall Copilot extension
  3. Clear browser cache and cookies
Rate Limiting Sign-in blocked with "Too Many Requests" error
  1. Wait 1-2 minutes before retrying
  2. Check GitHub API rate limits
  3. Use a different network or VPN
Extension Not Loading Copilot panel does not appear in IDE
  1. Ensure Copilot is enabled in IDE settings
  2. Restart IDE and reload extensions
  3. Reinstall Copilot from marketplace
Token Expired Sign-in works but immediately logs out
  1. Reauthorize GitHub token in Copilot settings
  2. Refresh or regenerate personal access token
  3. Check for expired tokens in GitHub settings
Note: If issues persist, contact GitHub Support with error logs and environment details.

11. Disabling Copilot for Specific Languages

Language Disabled Notes
JavaScript false Enabled by default
TypeScript false Enabled by default
Python true Disabled via settings
Java false Enabled by default
Go true Disabled via settings

Example: Disabling Copilot for Python

{
  "github.copilot.enable": {
    "python": false
  }
}

Was this article helpful?