How to Use GitHub Copilot for Real-Time Code Suggestions in 2 Hours
How to Use GitHub Copilot for Real-Time Code Suggestions in 2 Hours
As indie hackers and solo founders, we often find ourselves wrestling with the complexities of coding. Whether you're a seasoned developer or just starting, the prospect of writing code can feel daunting. That's where GitHub Copilot comes in. In 2026, Copilot has evolved into a powerful AI coding assistant that offers real-time code suggestions, making your coding journey smoother. However, many still wonder: how do you actually leverage this tool effectively?
In this guide, I’ll walk you through setting up and using GitHub Copilot within 2 hours, so you can start coding smarter, not harder.
Prerequisites: What You Need Before Starting
Before diving in, you’ll need a few things:
- GitHub Account: Sign up for a free account if you don't have one already.
- Visual Studio Code (VS Code): This is the primary IDE that works seamlessly with Copilot. Download and install it from here.
- GitHub Copilot Subscription: As of 2026, GitHub Copilot costs $10/month or $100/year, with a free trial available for the first 30 days.
Step 1: Setting Up GitHub Copilot
- Install VS Code: Once you have VS Code installed, open it.
- Install the Copilot Extension:
- Go to the Extensions view by clicking on the square icon in the sidebar.
- Search for "GitHub Copilot" and click "Install".
- Sign In to GitHub: After installation, you will be prompted to sign in to your GitHub account. Follow the on-screen instructions.
- Enable Copilot: Once signed in, you may need to enable Copilot in your settings. Go to Preferences > Settings > Extensions > GitHub Copilot and toggle it on.
Expected Output: You should see a new Copilot icon in your sidebar, indicating that it’s ready to assist you.
Step 2: Writing Your First Code with Copilot
Now that Copilot is set up, let's write some code together. This step will take about 30 minutes.
- Create a New File: Start a new JavaScript file in VS Code.
- Write a Comment: Begin by typing a comment that describes what you want to achieve. For example:
// Function to calculate the factorial of a number - Trigger Copilot Suggestions: After writing the comment, hit "Enter". Copilot will automatically suggest code based on your comment. You can accept the suggestion by hitting "Tab".
Expected Output: You should see Copilot generate a function that calculates the factorial based on your comment.
Step 3: Fine-Tuning Suggestions
Copilot's suggestions may not always be perfect. Here's how to refine them effectively:
- Modify Your Comment: If the suggestion isn’t quite right, try rephrasing your comment for clarity.
- Use Inline Suggestions: As you type, Copilot will continuously suggest completions. You can cycle through options using the arrow keys.
- Learn from the Suggestions: Even if you don’t accept a suggestion, analyze the code to improve your own skills.
Troubleshooting Common Issues
If you encounter issues with Copilot, here are some common problems and solutions:
- Copilot Not Suggesting: Ensure that you're connected to the internet and that the extension is enabled.
- Suggestions Not Relevant: Try writing more specific comments or keywords; Copilot performs better with context.
- Performance Issues: If VS Code feels slow, try disabling other extensions or restarting the application.
What's Next: Building a Simple Project
After getting comfortable with Copilot, consider building a small project to put your skills to the test. Here are a few ideas:
- To-Do List App: Use Copilot to help structure your app and manage tasks.
- Weather App: Query an API and let Copilot assist with parsing data.
- Personal Portfolio: Create a website and use Copilot for HTML and CSS suggestions.
Conclusion: Start Here
In our experience, GitHub Copilot can significantly reduce coding time and help you learn on the go. By following this guide, you should be set up and ready to leverage real-time code suggestions in under 2 hours.
If you're serious about coding and want to maximize your productivity, GitHub Copilot is a worthwhile investment. Remember, the more you use it, the better it gets at understanding your coding style.
What We Actually Use
While we recommend GitHub Copilot for coding assistance, we also use other tools like:
- Postman for API testing: Free, but $12/mo for advanced features.
- Figma for design: Free tier available, $12/mo for teams.
Follow Our Building Journey
Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.