Ai Coding Tools

How to Train GitHub Copilot to Write Your Code in 2 Hours

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step guide on optimizing GitHub Copilot’s capabilities to tailor it to your specific coding style and needs.

If you’re a solo founder or indie hacker, you know the pain of writing code can be a bottleneck. You want to build and ship, not get bogged down in syntax and logic. Enter GitHub Copilot, a tool promising to ease that burden. But just installing it isn’t enough; you need to train it to understand your coding style and project context. In this guide, I’ll show you how to effectively train GitHub Copilot to write your code in just 2 hours.

Prerequisites: What You Need Before You Start

  • GitHub Account: Make sure you have an active GitHub account.
  • Visual Studio Code: Download and install Visual Studio Code (VS Code) if you haven’t yet.
  • GitHub Copilot Subscription: Copilot costs $10/month for individuals, with a free trial available.
  • Sample Codebase: Have a small project or some code snippets ready to work with.

Step 1: Install GitHub Copilot

  1. Open VS Code.
  2. Go to Extensions (Ctrl+Shift+X).
  3. Search for “GitHub Copilot” and click “Install.”
  4. Sign in with your GitHub account.

Expected output: After installation, you should see a Copilot icon in the bottom right corner of VS Code.

Step 2: Configure Copilot to Learn Your Style

  1. Start with a coding style guide that you follow (or create one if you don’t have one).
  2. Write a few functions or classes that represent your coding style. Make sure to comment on what each function does.
  3. Use descriptive variable names and consistent formatting.

Expected output: Copilot will start to recognize patterns based on your writing style.

Step 3: Create a Training Dataset

  1. Add at least 100 lines of code to your project that illustrate your typical coding patterns, including comments.
  2. Make use of different programming constructs like loops, conditionals, and data structures.
  3. Include edge cases and unique problem-solving approaches you typically use.

Expected output: A well-structured codebase that Copilot can learn from.

Step 4: Interact with Copilot

  1. Start typing a function or a comment, and let Copilot suggest completions.
  2. Accept suggestions that align with your style and reject those that don’t.
  3. Provide feedback by editing the generated code to reinforce your preferences.

Expected output: Copilot will begin to adapt and improve its suggestions based on your interactions.

Step 5: Test and Iterate

  1. Create test cases based on your codebase.
  2. Run tests to see if Copilot's suggestions pass or fail.
  3. Continuously refine your code and Copilot's training dataset based on what works and what doesn’t.

Expected output: A more tailored coding assistant that understands your specific needs.

Troubleshooting: What Could Go Wrong

  • Poor Suggestions: If Copilot suggests irrelevant code, try adding more examples to your training dataset.
  • Syntax Errors: Always double-check the code Copilot generates; it’s not foolproof.
  • Performance Issues: Sometimes, Copilot can lag. Restart VS Code if it becomes unresponsive.

What's Next: Building on Your Training

After you’ve trained Copilot, consider exploring other AI tools that can complement your workflow. For example, tools like ChatGPT can help brainstorm ideas, while CI/CD tools can automate deployment.

Tool Comparison: GitHub Copilot vs. Other AI Coding Tools

| Tool | Pricing | Best For | Limitations | Our Take | |--------------------|-------------------------|-------------------------------|-------------------------------------|-------------------------------| | GitHub Copilot | $10/mo | Quick code suggestions | May not understand complex logic | We use this for rapid prototyping. | | Tabnine | Free tier + $12/mo pro | Autocompletions for multiple languages | Limited to specific IDEs | We don't use this because it lacks GitHub integration. | | Codeium | Free | Open-source projects | Fewer features than Copilot | We use this for community projects. | | Replit | Free tier + $7/mo pro | Collaborative coding | Limited offline capabilities | We occasionally use this for team projects. | | Sourcery | $19/mo | Python code improvement | Python-only | We don’t use this because we need multi-language support. | | AI Code Reviewer | $15/mo | Code quality checks | Less focus on suggestions | We haven't used this yet, but it looks promising. |

Conclusion: Start Here

To truly harness the power of GitHub Copilot, dedicate 2 hours to train it using the steps outlined above. This investment will pay off by significantly speeding up your coding process.

If you want to dive deeper into building and shipping products, don’t forget to check out our podcast, where we share real insights from our building journey.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read