How to Use GitHub Copilot to Write Your First Code in 10 Minutes
How to Use GitHub Copilot to Write Your First Code in 10 Minutes
In 2026, coding isn't just for seasoned developers anymore. With tools like GitHub Copilot, even total beginners can start writing code quickly. But here's the catch: many people feel overwhelmed when trying to dive into coding. The good news? You can start coding your first project in just 10 minutes with GitHub Copilot.
Let’s break down how to do this step-by-step, including what you need, what to expect, and some common pitfalls to avoid.
Prerequisites: What You Need Before You Start
- GitHub Account: Sign up for a free GitHub account if you don’t have one.
- Visual Studio Code (VS Code): Download and install Visual Studio Code, which is a free code editor.
- GitHub Copilot Subscription: GitHub Copilot costs $10/month after a free trial. Make sure you sign up for that to get started.
- Basic Understanding of Programming Concepts: Familiarity with concepts like variables, functions, and loops will help, but it's not strictly necessary.
Step 1: Install GitHub Copilot
- Open Visual Studio Code.
- Go to the Extensions panel on the left sidebar.
- Search for "GitHub Copilot" and click "Install".
- Follow the prompts to log in to your GitHub account and authorize the extension.
Expected Output: You should see a "Copilot is ready!" message in the bottom right corner of VS Code.
Step 2: Create a New File
- Create a new file in VS Code by clicking on "File" > "New File".
- Save it with a
.jsextension (for JavaScript) or another language of your choice (like Python with a.pyextension).
Expected Output: You now have a new file ready for coding.
Step 3: Write Your First Code
- Start typing a comment that describes what you want to do. For example, type
// Create a function that adds two numbers. - Press
Enter, and GitHub Copilot will suggest code based on your comment.
Expected Output: You should see a function appear that adds two numbers together.
Step 4: Accepting Suggestions
- If the suggestion looks good, press
Tabto accept it. - If it’s not quite right, you can cycle through other suggestions by pressing
Ctrl+](orCmd+]on Mac).
Expected Output: You’ve now accepted your first piece of code!
Step 5: Run Your Code
- If you're using JavaScript, you can run the code directly in the terminal with Node.js. Make sure to install Node.js if you haven't already.
- Open the terminal in VS Code (
View>Terminal) and typenode yourfilename.js.
Expected Output: You should see the result of your function in the terminal.
Troubleshooting: What Could Go Wrong
- Copilot Doesn’t Suggest Anything: Ensure you’ve typed a clear comment and that Copilot is activated.
- Syntax Errors: Make sure you have the correct programming language selected in the bottom-right corner of VS Code.
What’s Next?
Now that you’ve written your first piece of code, consider building on that. Try creating more complex functions, or explore different programming languages. GitHub Copilot can assist you in learning new syntax and libraries as you go along.
Conclusion: Start Here
If you're feeling stuck on where to begin with coding, GitHub Copilot is a valuable tool that can help you get started in just 10 minutes. Just ensure you have the right setup and a willingness to explore.
Remember, the key is to practice and build on what you learn. Happy coding!
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.