Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Lines of Code in 15 Minutes

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First 10 Lines of Code in 15 Minutes

As a beginner, diving into coding can feel overwhelming. You might find yourself staring at a blank screen, unsure of where to start. Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and more efficiently. In just 15 minutes, you can use Copilot to generate your first 10 lines of code. Let's break down how to do this, step by step.

Prerequisites: What You Need Before You Start

  1. GitHub Account: You’ll need a GitHub account to access Copilot.
  2. Visual Studio Code (VS Code): Download and install VS Code if you haven't already.
  3. GitHub Copilot Subscription: Copilot costs $10/month or $100/year as of April 2026, but you can start with a free trial.
  4. Basic Understanding of Programming Concepts: Familiarity with variables, functions, and syntax in the language you're using (like JavaScript, Python, etc.) will be helpful.

Step 1: Setting Up GitHub Copilot

  1. Install the GitHub Copilot Extension:

    • Open VS Code.
    • Go to the Extensions view (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and install it.
  2. Sign In to GitHub:

    • After installation, click on the Copilot icon in the sidebar.
    • Sign in using your GitHub credentials.
  3. Configure Settings:

    • Go to the settings (File > Preferences > Settings).
    • Search for "Copilot" and adjust any preferences to fit your coding style.

Step 2: Writing Your First Lines of Code

  1. Create a New File:

    • In VS Code, create a new file and save it with an appropriate extension (e.g., hello.js for JavaScript).
  2. Start Typing a Comment:

    • Begin with a comment that describes what you want to do. For example:
      // Create a function that returns 'Hello, World!'
      
  3. Watch Copilot Work:

    • As you type the comment, Copilot will suggest code. You'll see a greyed-out suggestion appear. Press Tab to accept it.
    • You should now have something like this:
      function greet() {
          return 'Hello, World!';
      }
      
  4. Testing Your Code:

    • Call your function at the end of the file:
      console.log(greet());
      
  5. Run Your Code:

    • Open a terminal in VS Code (Ctrl+`).
    • Run the code using Node.js:
      node hello.js
      
  6. Expected Output:

    • You should see Hello, World! printed in the terminal, confirming that your first lines of code are working.

Troubleshooting Common Issues

  • No Suggestions from Copilot: Ensure you're connected to the internet and that the extension is enabled.
  • Incorrect Code Suggestions: If Copilot suggests code that doesn't work, you can type a bit more context or adjust your comments for clearer instructions.
  • Subscription Issues: If you encounter issues with your subscription, check your GitHub billing settings.

What’s Next?

After writing your first lines of code, consider exploring more complex functions or projects. Here are some suggestions:

  • Build a Simple Calculator: Use Copilot to generate functions for addition, subtraction, multiplication, and division.
  • Create a To-Do List App: Expand your skills by creating a basic web app using HTML, CSS, and JavaScript.
  • Learn Version Control with Git: Start using Git to track changes in your projects.

Conclusion: Start Here

Using GitHub Copilot can dramatically reduce the time it takes to write code, especially for beginners. In just 15 minutes, you can create your first lines of code and gain confidence in your coding abilities. If you haven’t tried Copilot yet, I highly recommend giving it a go. It’s a practical tool that can help you learn and build faster.

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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
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