GitHub Copilot Installation & Setup Guide for VS Code and JetBrains IDEs (2026)
GitHub Copilot Installation & Setup Guide for VS Code and JetBrains IDEs
GitHub Copilot is an AI-powered coding assistant that provides real-time code suggestions, chat-based help, and workspace-aware intelligence. This guide walks you through installing, configuring, and optimizing Copilot across VS Code and JetBrains IDEs, including language-specific tuning, Copilot Chat, workspace indexing, and organization policy management.
Prerequisites
- A GitHub account with an active Copilot subscription (Individual, Business, or Enterprise)- VS Code 1.90+ or a JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.) version 2024.1+- Node.js 18+ (recommended for workspace indexing features)- Stable internet connection for initial authentication
Step 1: Install the GitHub Copilot Extension
VS Code Installation
- Open VS Code and navigate to the Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X).- Search for GitHub Copilot and click Install. This installs both the inline suggestion engine and Copilot Chat.- Alternatively, install from the command line:code —install-extension GitHub.copilot code —install-extension GitHub.copilot-chat- Reload VS Code when prompted. A Copilot icon will appear in the status bar.- Click the icon and select Sign in to GitHub. Complete the OAuth flow in your browser.
JetBrains IDE Installation
- Open your JetBrains IDE and go to Settings → Plugins → Marketplace.- Search for GitHub Copilot and click Install.- Restart the IDE when prompted.- Navigate to Settings → Tools → GitHub Copilot and click Login to GitHub.- Copy the device code, open the verification URL in your browser, and paste the code to authorize.
Step 2: Configure Language-Specific Suggestions
Copilot supports all major languages but you can fine-tune which languages receive suggestions.
VS Code — settings.json
{
“github.copilot.enable”: {
”*”: true,
“python”: true,
“javascript”: true,
“typescript”: true,
“markdown”: false,
“plaintext”: false,
“yaml”: true
},
“github.copilot.advanced”: {
“inlineSuggestCount”: 3,
“length”: 500
}
}
JetBrains — Language Filters
- Go to Settings → Tools → GitHub Copilot → Languages.- Toggle individual languages on or off. For example, disable Copilot for
.envand.propertiesfiles to avoid leaking secrets.- Use file pattern exclusions to block suggestions in sensitive directories:# In .copilotignore (place in project root) .env config/secrets/** *.pem *.key
Step 3: Set Up Copilot Chat
Copilot Chat provides a conversational interface for code explanation, generation, test writing, and debugging.
VS Code Chat Configuration
- Open Chat with
Ctrl+Shift+I(orCmd+Shift+Ion macOS).- Use slash commands for targeted actions:Command Purpose Example /explainExplain selected code Select a function, then type /explain/fixSuggest a fix for errors Highlight a bug, type /fix/testsGenerate unit tests /tests for the selected function/docGenerate documentation /doc add JSDoc comments@workspaceQuery the entire project @workspace how is auth handled?
JetBrains Chat
- Open the Copilot Chat tool window from View → Tool Windows → GitHub Copilot Chat.- The same slash commands work in JetBrains. Right-click any code selection and choose Copilot → Explain This for quick inline help.
# Example: Ask Copilot Chat to generate a Python test /tests Write pytest tests for the calculate_discount function in pricing.py
Step 4: Enable Workspace Indexing
Workspace indexing allows Copilot to understand your entire codebase for more relevant suggestions and accurate @workspace answers.
VS Code
{
“github.copilot.chat.codeGeneration.useWorkspaceContext”: true,
“github.copilot.chat.indexing.enabled”: true,
“github.copilot.chat.indexing.maxFiles”: 5000
}- After enabling, VS Code will index your workspace in the background. Check progress in the Output panel under GitHub Copilot.- For large monorepos, create a .copilotignore file to exclude build artifacts, node_modules, and vendor directories from indexing.
JetBrains
- Go to Settings → Tools → GitHub Copilot → Indexing.- Enable Project-wide context and configure excluded directories.- Indexing respects your existing
.gitignorepatterns automatically.
Step 5: Organization Policy Settings
For Copilot Business and Enterprise plans, administrators can enforce policies across the organization.
GitHub Organization Admin Panel
- Go to github.com → Organization → Settings → Copilot → Policies.- Configure key policies:
Policy Description Recommended Setting Suggestions matching public code Block suggestions that match public repositories Blocked (for enterprise compliance) Copilot Chat in IDE Enable or disable Chat features Enabled Copilot in CLI Allow Copilot in GitHub CLI Enabled Editor suggestions Allow inline code completions Enabled Content exclusions Prevent Copilot from accessing specific repos or paths Configure per-repo
Content Exclusion via Organization Settings
# In Organization Settings → Copilot → Content Exclusions
Add repository-level exclusions:
repository: my-org/secrets-repo
paths:
- ”**/*.env”
- “config/production/**”
”**/credentials.*“
Managing Seat Assignments via CLI
# List current Copilot seat assignments
gh api /orgs/YOUR_ORG/copilot/billing/seats --paginate
# Add a user to Copilot
gh api --method POST /orgs/YOUR_ORG/copilot/billing/selected_users \
-f selected_usernames[]="developer-username"
# Remove a user
gh api --method DELETE /orgs/YOUR_ORG/copilot/billing/selected_users \
-f selected_usernames[]="developer-username"
Pro Tips
- Trigger multiple suggestions: Press
Ctrl+Enterin VS Code to open the Copilot completions panel showing up to 10 alternative suggestions.- Inline chat: PressCtrl+Iin VS Code to open an inline chat prompt directly in your editor without switching context.- Custom instructions: Create a.github/copilot-instructions.mdfile in your repository root to provide project-specific context to Copilot. For example:This project uses FastAPI with SQLAlchemy. Always use async/await patterns and Pydantic v2 models.- Keyboard shortcuts for JetBrains: UseAlt+</code> to manually trigger a suggestion andTabto accept it. UseAlt+]andAlt+[to cycle through alternatives.- Prompt engineering: Write a descriptive comment before a function to get better suggestions. Include parameter types, return values, and edge cases in your comment.
Troubleshooting
Issue Cause Solution Copilot icon shows "Inactive" Authentication expired or subscription lapsed Click the icon and re-authenticate. Verify your subscription at github.com/settings/copilot No suggestions appearing Language disabled or file excluded Check github.copilot.enable settings and .copilotignore file Chat returns "Unable to process" Workspace index not built or too large Reduce maxFiles or add exclusions. Restart the extension host JetBrains plugin not loading Incompatible IDE version Update to version 2024.1 or later. Reinstall the plugin Organization policy blocking suggestions Admin-enforced content exclusion Contact your GitHub org admin to review Copilot policy settings High latency on suggestions Network or proxy configuration Configure proxy in IDE settings. Set "http.proxy" in VS Code or JetBrains HTTP settings
## Frequently Asked Questions
Can I use GitHub Copilot offline?
No. GitHub Copilot requires an active internet connection to generate suggestions because the AI model runs on GitHub's cloud servers. However, once suggestions are accepted into your code, you can work offline normally. The Copilot Chat feature also requires connectivity for every interaction.
How do I prevent Copilot from suggesting code that matches public repositories?
For individual users, go to github.com → Settings → Copilot and enable the Block suggestions matching public code filter. For organizations, administrators can enforce this policy at Organization → Settings → Copilot → Policies → Suggestions matching public code → Blocked. This applies a duplication detection filter that suppresses suggestions closely matching publicly available code.
Does GitHub Copilot work with all programming languages?
Copilot supports virtually all languages that appear in public repositories, but it performs best with languages that have extensive training data: Python, JavaScript, TypeScript, Java, C#, C++, Go, Ruby, and Rust. For less common languages, suggestions may be less accurate. You can improve results by providing detailed comments and using the .github/copilot-instructions.md file to specify language conventions and frameworks used in your project.