DX Heroes logo
#ai
#guide

How to get started with GitHub Copilot?

Length: 

12 min

Published: 

October 16, 2025

How to get started with GitHub Copilot?

GitHub Copilot can speed up development by up to 50% in many teams.

You may have heard of it but haven't tried it yet. We'll walk through the setup and the first steps to get started.

Copilot isn't just for developers, though. It also helps analysts, testers, and non-IT people with simple scripts and prototypes, often without any prior programming experience.

It's still an assistant, not an autopilot. Start small and gradually discover what it can do in your context.

What is it and what to expect from it?

GitHub Copilot is an AI assistant for programming. It significantly speeds up writing code. It is powered by advanced AI models, mainly from OpenAI and Anthropic.

How does it work? Copilot reads the context of your project: text, code you've already written, file names, and comments. Based on that, it suggests what comes next: more lines, whole functions, and tests. You control it in plain language, like "create a function to add two numbers". The suggestion appears straight away in the editor.

What can it do?

  • Code completion: it predicts and offers a continuation of the code you write.
  • Generation from comments: it creates code from a text description.
  • Explaining code: it helps you understand complex or unfamiliar sections.
  • Refactoring: it suggests how to improve code structure and readability.
  • Creating tests: it generates unit and integration tests for your code.
  • Copilot panel (central interface): the place where you interact with Copilot and choose the mode of work, that is chat (only suggests), editor (changes the current file), or agent (works across the project).
    • Copilot Chat: an interactive window for AI conversation. Used for troubleshooting or code questions. It makes no automatic changes to the code itself.
    • Copilot Edit (inline editor): edits only the currently open file. Less autonomous than an agent. It typically suggests a solution (diff) and you confirm the change.
    • Copilot Agent: handles complex tasks across files (for example, fix all errors in a file), including the use of tools such as commands.

Tip: Start in Chat to understand the problem, use Edit for quick local changes, and then bring in Agent for broader work across the repository.

Expect Copilot to speed up your work. It cuts the time you spend on routine code writing. It also helps you learn: it shows new patterns and different ways to solve a problem. Often it supplies a solid initial draft that you then adjust to suit yourself.

It is not a replacement for the developer, though. Human logic and critical thinking stay key. The generated code is not flawless, so check it, test it, and watch for bugs, security holes, or inefficient implementation. Even with access to the project, without enough context (rules, documentation, comments) Copilot behaves like a developer in someone else's code: it guesses part of the intent and the results may diverge from what you want. The bigger the changes it generates, the more so.

Installation and first steps

Before you start using GitHub Copilot, install the extension in your favorite development environment.

Supported IDEs:

  • Visual Studio Code: the most common choice, easy to install via the Marketplace.
  • Visual Studio: full support for development in .NET and other technologies.
  • JetBrains IDEs: integrated environment for PyCharm, IntelliJ IDEA, WebStorm, and others.
  • Azure Data Studio: support for working with databases.

How to activate Copilot:

  • Step 1, install the extension: open the extension manager in your IDE, search for "GitHub Copilot", and install it.
  • Step 2, log in: after installation, you sign in with your GitHub account. Confirm authorization in your web browser.
  • Step 3, activate the subscription: make sure you have an active GitHub Copilot subscription. There is a trial version, paid plans for individuals (Pro), and plans for businesses (Enterprise).

Example: installation in VS Code

  1. Open VS Code -> Extensions (Ctrl+Shift+X)
  2. Search for "GitHub Copilot"
  3. Click on "Install"
  4. After installation, the Copilot icon appears in the bottom right corner. If not, restart the IDE.

Tip: After installation and login, check that the Copilot icon is active in your IDE's status bar (most likely bottom right). Try typing function helloWorld() { in a new JavaScript file and watch whether Copilot offers a completion. If it does, you're ready to start coding with AI.

Basic work with Copilot

After installation and activation, learn the main ways to use GitHub Copilot. You work with it mainly two ways: through code suggestions and through Copilot Chat.

Code suggestions:

  • "Ghost text": code suggestions appear directly in your editor as transparent text.
  • Accept: press Tab to accept the whole suggestion.
  • Reject: press Esc to dismiss the current suggestion.
  • Cycle through suggestions: when Copilot offers more than one option, switch between them with Alt/Option + ] and Alt/Option + [.
  • Example: start typing a function and Copilot offers a completion.
def factorial(n):
    # Copilot offers: if n == 0: return 1
    # Copilot offers: else: return n * factorial(n-1)

Copilot Instructions (system prompt)

To make Copilot advise in your style and with respect to your project, add copilot-instructions.md to the repository. Copilot takes it into context during chat and inline generation.

What to put in it:

  • How we think about code: architecture, domain concepts, preferred patterns and anti-patterns.
  • Code style and conventions: naming, module structure, comments on new functions, test requirements.
  • Tech stack: language, frameworks, libraries, internal utilities.
  • Quality and security: required checks, lint and formatting, security policies.
  • How we assign tasks to Copilot: short examples of good prompts (what to do and what to avoid).
# Copilot Instructions
## Style & Conventions
- Use … naming
- Every new function: docstring + example
## Tech Stack
- Language/Framework: …
## Quality
- Tests: unit + coverage ≥ …
## Prompts
- When asked to refactor, keep public API stable and add tests.

Copilot Chat

  • Inline query: use Ctrl/Cmd + I to open the chat window directly in the editor next to the selected code. Good for quick questions about a specific section.
  • Separate panel: open Ctrl/Cmd + Shift + I for the full chat panel. Here you ask more general questions, generate new files, or solve more complex problems.
  • Slash commands: run special commands in chat for specific actions:
    • /explain: explains the selected code.
    • /tests: generates unit tests for the selected code.
    • /fix: suggests fixes for errors in the selected code.
    • /refactor: helps with code refactoring.
    • /new: creates a new code file from a description.
  • Example: select a function and type /explain selected code in the chat.
  • Example: select a function and type /tests for this function in the chat.

Tip: Start with inline suggestions, they are intuitive and the fastest. When you hit a more complex problem or need an explanation, switch to Copilot Chat. Experiment with slash commands. You quickly tell Copilot what you want without too much sauce around it, and your work gets more efficient.

Code generation and completion

GitHub Copilot helps you with code in two main ways: code completions and Copilot Chat. Each suits a different situation.

Code Completions

This is the primary way Copilot works. It offers suggestions directly as you write code.

  • How it works: Copilot analyzes the code you write and offers immediate suggestions. They appear as gray text, which you accept by pressing Tab.
  • Limited context: for code completions Copilot uses a limited context. It focuses on the code in the current file and a few surrounding files.
  • When to use: good for smaller tasks, completing lines, generating boilerplate code, or writing simple functions.

Example (boilerplate):

# Create a basic Flask application
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

Example (finishing):

function fetchData(url) {
    // After typing "return fetch(url).t" Copilot suggests "hen(res => res.json());"
    return fetch(url).then(res => res.json());
}

Copilot Chat

Copilot Chat is an interactive interface where you have a dialogue with Copilot. It suits more complex tasks.

  • How it works: you ask questions in natural language and Copilot responds with code, explanations, or suggestions. It has access to the broader context.
  • Greater context: Copilot Chat works with a context of up to 128k tokens. That lets it "see" more files in your project and understand more complex problems.
  • When to use:
    • Complex tasks: generating entire components or refactoring larger blocks of code.
    • Analysis: explaining code, finding bugs, or suggesting improvements.
    • Research: getting information about libraries or APIs.
User: "Write me a function in Python that loads data from a JSON file and returns it as a dictionary. Add error handling."
Copilot:
import json
def load_json_data(filepath):
    try:
        with open(filepath, 'r', encoding='utf-8') as f:
            data = json.load(f)
        return data
    except FileNotFoundError:
        print(f"Error: File '{filepath}' was not found.")
    except json.JSONDecodeError:
        print(f"Error: File '{filepath}' is not a valid JSON format.")
    except Exception as e:
        print(f"An unexpected error occurred while reading file '{filepath}': {e}")
    return None

Best practices

You'll get the most out of Copilot by following these tips:

  • Write idiomatically: write code the way an experienced programmer would write it in that language. Copilot is trained on millions of lines of code and responds better to common patterns and conventions.
    • Why: when you write by standard practices, Copilot better anticipates what you want and offers more relevant suggestions.
  • Keep files open: the more relevant files you have open in your IDE, the more context Copilot has. It then generates more accurate and relevant code.
    • Why: Copilot "reads" open files. It understands dependencies, data structures, and existing logic.
  • Context equals quality: the quality of the generated code depends directly on the context you give Copilot.
    • Explanation: the more relevant code, comments, and open files Copilot sees, the better it understands your intentions. The suggestions are then more accurate, relevant, and usable.

Summary

After a quick installation and activation, GitHub Copilot significantly speeds up your routine work in the IDE. It can complete code, generate functions from comments, explain unfamiliar parts of code, suggest refactoring, and create tests. Through Copilot Chat, you solve specific tasks and broader questions. But it's still an assistant: check the suggestions, test them, and give it the best context so the result is worth it.

Now you have everything you need to start using GitHub Copilot. We're planning a follow-up to this series where we'll go deeper: refactoring and optimization, test generation, and finally how to reach higher code quality when using Copilot on a team.

Want to stay one step ahead?

Don't miss our best insights. No spam, just practical analyses, invitations to exclusive events, and podcast summaries delivered straight to your inbox.