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

Worst 10 Mistakes When Using AI Coding Tools

Worst 10 Mistakes When Using AI Coding Tools As we dive into 2026, AI coding tools have become an integral part of the development landscape. However, many developers, especially i

Apr 29, 20264 min read
Ai Coding Tools

How to Build a Personal AI Code Assistant in 60 Minutes

How to Build a Personal AI Code Assistant in 60 Minutes If you're a solo founder or indie hacker, you know the pain of spending hours debugging code or searching for snippets onlin

Apr 29, 20264 min read
Ai Coding Tools

Balance in Coding: GitHub Copilot vs. Codeium for 2026

Balance in Coding: GitHub Copilot vs. Codeium for 2026 As we dive into 2026, AI coding assistants like GitHub Copilot and Codeium have become essential tools for developers. The pr

Apr 29, 20263 min read
Ai Coding Tools

How to Build a Simple AI-Powered App in Just 48 Hours

How to Build a Simple AIPowered App in Just 48 Hours Building an AIpowered app might sound like a daunting task, especially if you’re new to coding or don’t have a technical backgr

Apr 29, 20264 min read
Ai Coding Tools

How to Write a Python Function Using AI in Under 15 Minutes

How to Write a Python Function Using AI in Under 15 Minutes For many indie hackers and solo founders, programming can feel like a daunting task, especially when you're trying to in

Apr 29, 20264 min read
Ai Coding Tools

How to Increase Your Coding Efficiency by 200% with AI in 30 Days

How to Increase Your Coding Efficiency by 200% with AI in 30 Days As a solo founder or indie hacker, you know that time is money. The more efficient you are at coding, the faster y

Apr 29, 20264 min read