Ai Coding Tools

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

By BTW Team3 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step tutorial guiding beginners on how to leverage GitHub Copilot to create a simple project from start to finish in just 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.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read