Ai Coding Tools

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

By BTW Team4 min read

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

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.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for Beginners

10 Common Mistakes When Using AI Coding Tools for Beginners As a beginner in coding, diving into AI coding tools can feel like a doubleedged sword. On one hand, these tools promise

Oct 8, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read