Ai Coding Tools

How to Use GitHub Copilot to Write Your First 100 Lines of Code in 2 Hours

By BTW Team4 min read

How to Use GitHub Copilot to Write Your First 100 Lines of Code in 2 Hours

If you're a beginner coder, the prospect of writing your first lines of code can be daunting. You might feel overwhelmed by the syntax, libraries, and frameworks. But what if you had a coding buddy that could help you along the way? Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and more efficiently. In this guide, I’ll walk you through how to leverage GitHub Copilot to write your first 100 lines of code in just two hours.

Time Estimate: 2 Hours

You'll need about two hours to set everything up and write your first 100 lines of code. This includes time for installation, some basic setup, and actually writing the code.

Prerequisites

Before diving in, make sure you have the following:

  1. A GitHub account (free)
  2. Visual Studio Code (VS Code) installed on your computer
  3. GitHub Copilot subscription (the free trial or $10/month for individuals)
  4. Basic understanding of programming concepts (variables, functions, etc.)

Step-by-Step Guide

Step 1: Set Up GitHub Copilot

  1. Install Visual Studio Code: Download and install VS Code from here.
  2. Install GitHub Copilot:
    • Open VS Code.
    • Go to Extensions (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and click "Install".
  3. Log In to GitHub: After installation, you’ll be prompted to log in to your GitHub account. Follow the instructions to authorize Copilot.

Step 2: Create a New Project

  1. Create a New Folder: Make a new directory on your computer where your project will reside.
  2. Open the Folder in VS Code: Use the "Open Folder" option in VS Code to navigate to your new project folder.
  3. Create a New File: Create a new file named app.js (or any language you prefer).

Step 3: Write Your First Lines of Code

  1. Start with Comments: Type // This is my first project with GitHub Copilot and hit "Enter". Copilot will suggest code based on your comment.
  2. Define a Function: Type function greet(name) { and hit "Enter". Copilot will suggest the rest of the function. Accept the suggestion by hitting "Tab".
  3. Call the Function: Type greet('World'); and see what Copilot suggests next.

Step 4: Iterate and Experiment

  1. Add More Functions: Try typing comments for other functions you want to create. For example, // Function to add two numbers.
  2. Use Copilot Suggestions: Accept or modify the suggestions from Copilot. This will help you learn how to structure your code.
  3. Write 100 Lines: Keep adding more lines of code until you reach 100. Use different programming constructs like loops, conditionals, and arrays.

Expected Outputs

By the end of this process, you should have a basic application in your app.js file with at least 100 lines of code. You might see functions for greeting users, performing calculations, or even simple data manipulation.

Troubleshooting

  • If Copilot Isn't Suggesting: Ensure you’re connected to the internet and that your subscription is active.
  • No Suggestions on Specific Tasks: Try rephrasing your comments or starting with a simpler idea.
  • Errors in Code: Remember, Copilot is a tool, not a perfect solution. Be ready to debug and learn from mistakes.

What's Next

Once you have your first 100 lines of code, consider building on it. You can:

  • Add more functionality to your project.
  • Share your code on GitHub to get feedback.
  • Explore more advanced features of GitHub Copilot.

Conclusion: Start Here

Getting started with coding can feel like a mountain to climb, but with tools like GitHub Copilot, the journey becomes manageable. I recommend starting with simple projects, using Copilot to guide you, and gradually increasing complexity as you gain confidence.

If you’re ready to dive into coding, set up GitHub Copilot today and write your first lines of code in just two hours!

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

Cursor vs GitHub Copilot: Which is Best for Indie Developers in 2026?

Cursor vs GitHub Copilot: Which is Best for Indie Developers in 2026? As an indie developer, finding the right coding assistant can make or break your productivity. With the rise o

Jul 21, 20263 min read
Ai Coding Tools

How to Build a Simple Application Using AI Coding Tools in 2 Hours

How to Build a Simple Application Using AI Coding Tools in 2 Hours If you’re a solo founder or an indie hacker, the idea of building a simple application might seem daunting, espec

Jul 21, 20264 min read
Ai Coding Tools

Bolt.new vs GitHub Copilot: Which AI Tool is Better for Your Projects?

Bolt.new vs GitHub Copilot: Which AI Tool is Better for Your Projects? As a solo founder or indie hacker, choosing the right AI coding tool can feel overwhelming. With so many opti

Jul 21, 20263 min read
Ai Coding Tools

How to Generate Code Snippets Using GitHub Copilot in 10 Minutes

How to Generate Code Snippets Using GitHub Copilot in 10 Minutes If you’re anything like me, you’ve probably found yourself staring at a blank screen, wondering how to start coding

Jul 21, 20263 min read
Ai Coding Tools

Cursor vs Codeium: Which AI Coding Tool Suits Developers Best?

Cursor vs Codeium: Which AI Coding Tool Suits Developers Best? (2026) As developers, we’re always looking for tools that can streamline our workflow and enhance productivity. AI co

Jul 21, 20264 min read
Ai Coding Tools

How to Build a Simple App Using AI Coding Assistants in 2 Hours

How to Build a Simple App Using AI Coding Assistants in 2 Hours Building a simple app can feel daunting, especially if you're not a seasoned developer. But what if I told you that

Jul 21, 20264 min read