Ai Coding Tools

How to Use GitHub Copilot to Code Your First Project in 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Code Your First Project in 2 Hours

If you're just starting out with coding, you've probably faced the daunting task of figuring out how to make your first project come to life. It's overwhelming, right? You want to build something, but where do you even start? Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and with less frustration. In this guide, I’ll walk you through how to use GitHub Copilot to kickstart your first project in just 2 hours.

Prerequisites: What You Need

Before diving in, make sure you have the following:

  • A GitHub account: Sign up for free at github.com.
  • Visual Studio Code: Download and install it from code.visualstudio.com.
  • GitHub Copilot subscription: The pricing is $10/month or $100/year, which is a solid investment for solo builders.
  • Basic understanding of programming concepts: You don’t need to be a pro, but familiarity with variables, functions, and control structures is helpful.

Step-by-Step: Getting Started with GitHub Copilot

1. Install GitHub Copilot

  • Open Visual Studio Code.
  • Go to Extensions (the square icon on the sidebar).
  • Search for "GitHub Copilot" and click "Install."
  • Sign in with your GitHub account and activate your subscription.

2. Start a New Project

  • Create a new directory for your project in your terminal or file explorer.
  • Open this directory in Visual Studio Code.
  • Create a new file (e.g., app.js for a JavaScript project).

3. Write Your First Function

Type out a comment describing the function you want to create. For instance:

// Function to add two numbers

As you type, GitHub Copilot will suggest code completions. Press Tab to accept a suggestion. You'll see something like this:

function add(a, b) {
    return a + b;
}

4. Test Your Function

Add some test cases to ensure your function works as expected:

console.log(add(2, 3)); // Should print 5
console.log(add(-1, 1)); // Should print 0

Run the code in your terminal to see the output.

5. Expand Your Project

Now that you have a basic function working, think about additional features you want to add. For example, if you’re building a calculator, you might want to add subtraction, multiplication, and division functions.

6. Use Copilot for More Complex Functions

For more complex functions, provide comments that outline what you want to achieve. For example:

// Function to multiply two numbers

Copilot will likely generate a function for you that you can modify as needed.

7. Save and Commit Your Code

Once you’re satisfied with your project, save your work and commit your changes to GitHub:

git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin master

Troubleshooting: What Could Go Wrong

  • Copilot doesn’t suggest anything: Ensure you’re typing in a code file and not a text or markdown file.
  • Suggestions don’t make sense: Sometimes Copilot may misunderstand your comment. Be specific with your prompts.

What's Next: Building Upon Your Project

Now that you’ve built your first project, consider expanding it by:

  • Adding a user interface using HTML/CSS.
  • Implementing more complex logic with additional JavaScript libraries.
  • Exploring deployment options on platforms like Vercel or Netlify.

Conclusion: Start Here

Using GitHub Copilot can significantly reduce the time it takes to write your first project. In just 2 hours, you can go from zero to a working application. If you’re looking to build something quickly and learn along the way, GitHub Copilot is a solid choice.

Final Recommendation: Start by writing simple functions and build from there. Use Copilot to speed up your learning process, but don’t forget to understand the code it generates.

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

Exposing the Myth: Why AI Coding Tools Can't Replace Human Developers

Exposing the Myth: Why AI Coding Tools Can't Replace Human Developers In 2026, the hype around AI coding tools has reached a fever pitch. Many indie hackers and solo founders are a

Aug 10, 20264 min read
Ai Coding Tools

Bolt.new vs GitHub Copilot: Which AI Coding Tool Delivers the Best Output?

Bolt.new vs GitHub Copilot: Which AI Coding Tool Delivers the Best Output? As a solo founder or indie hacker, you know the struggle of coding efficiently while juggling multiple pr

Aug 10, 20263 min read
Ai Coding Tools

How to Debug Code in 60 Minutes Using AI Coding Tools

How to Debug Code in 60 Minutes Using AI Coding Tools Debugging can be a soulcrushing experience for many developers. You stare at lines of code, trying to figure out why something

Aug 10, 20265 min read
Ai Coding Tools

Why AI Coding Tools Are Overrated: Common Myths Debunked

Why AI Coding Tools Are Overrated: Common Myths Debunked As indie hackers and solo founders, we often chase the latest trends hoping they will solve our biggest problems. AI coding

Aug 10, 20264 min read
Ai Coding Tools

Cursor vs GitHub Copilot: A Comprehensive Comparison for Developers in 2026

Cursor vs GitHub Copilot: A Comprehensive Comparison for Developers in 2026 As a developer, you know the pain of writing repetitive code and the endless search for solutions that c

Aug 10, 20263 min read
Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Functions

How to Use GitHub Copilot to Write Your First 10 Functions If you're a solo founder or an indie hacker just starting to dip your toes into coding, you might find the process of wri

Aug 10, 20263 min read