⭐ Introduction
Visual Studio Code (VS Code) integrates beautifully with GitHub, letting us manage our entire workflow — commits, pushes, pulls, branches, and pull requests — without ever leaving the editor.
If we already have Git installed and a GitHub account set up, connecting VS Code to GitHub is the next step.
📌 Prerequisites
Before continuing, make sure you have completed the following:
- Set up your local Git installation following the steps in the post Installing and Setting Up Git on Windows, macOS, and Linux
- Create and log into your GitHub account AND create a GitHub repository following the steps in the post Setting Up a GitHub Account & Creating Your First Repository
Once both sides (your local Git setup + your GitHub account/repository) are ready, you can integrate everything inside VS Code.
🚀 Setting Up GitHub Integration in VS Code
Below is the workflow you should follow.
1️⃣ Open your connected Git folder in VS Code
How to do it
- Open VS Code
- Go to File → Open Folder
- Select the project folder that is already connected to GitHub
VS Code automatically detects:
.gitfolder- Remote origin
- Your current branch
- Any uncommitted changes
Nothing else needs to be configured at this stage.
2️⃣ Make a small change to test Git integration
How to do it
- Open any file in the project
- Add a small change (example: add a comment)
- Save the file
VS Code will now show:
- Blue icon next to the edited file
- Change appearing in the Source Control panel
3️⃣ Commit your changes using VS Code Source Control
How to do it
- Open the Source Control panel (left sidebar)
- Review the changed files
- Type a commit message
- Click ✔ Commit
- Click Sync or Push when prompted
This sends your changes to GitHub.
This confirms that GitHub integration is working successfully.
🔌 4️⃣ Install Relevant GitHub Extensions (Highly Recommended)
Here are the best extensions to enhance your GitHub experience in VS Code.
📦 Extension 1: GitHub Pull Requests and Issues
- Name: GitHub Pull Requests and Issues
- Publisher: GitHub
- Extension ID:
GitHub.vscode-pull-request-github
What it adds:
- View pull requests directly in VS Code
- Review code inline
- Comment, approve, or request changes
- Manage GitHub issues without opening the browser
📦 Extension 2: GitHub Repositories
- Name: GitHub Repositories
- Publisher: GitHub
- Extension ID:
GitHub.remotehub
What it adds:
- Open GitHub repos without cloning
- Browse and edit files directly from the cloud
- Great for quick reviews or edits
📦 Extension 3: GitHub Codespaces (Optional)
- Name: GitHub Codespaces
- Publisher: GitHub
- Extension ID:
GitHub.codespaces
What it adds:
- Connect to cloud-based dev environments
- Run VS Code in the cloud
- Great for low-power laptops or collaborative work
📦 Extension 4: GitLens (Advanced Git Features) (Optional)
- Name: GitLens — Git supercharged
- Publisher: GitKraken
- Extension ID:
eamodio.gitlens
What it adds:
- Rich blame annotations
- Powerful history browsing
- File lineage and commit insights
- Branch comparison tools
⚙️ 5️⃣ Configure Extensions (If Needed)
Most extensions work out of the box.
But you can customize them:
GitHub Pull Requests and Issues settings:
- Configure default pull-request target branch
- Enable PR notifications
- Show GitHub issues in the sidebar
GitLens settings:
- Show blame info inline
- Toggle commit messages visibility
- Customize comparison view
VS Code automatically detects your GitHub credentials as long as Git CLI / Credential Manager is already authenticated.
🧪 6️⃣ Use Git + GitHub inside VS Code (Your New Workflow)
After setup, here’s your daily workflow:
✔ Edit code
✔ Commit using Source Control
✔ Push changes to GitHub
✔ Check PRs inside VS Code
✔ Work with branches easily
No browser switching unless required.
🎉 Conclusion
Once your local repository is connected to GitHub, VS Code becomes a powerful Git client.
You can commit, push, manage branches, and handle pull requests directly from the editor.
Adding extensions like:
- GitHub Pull Requests and Issues
- GitHub Repositories
- GitHub Codespaces
- GitLens
makes your environment even more productive.
This setup is simple, fast, and perfect for beginners learning Git + GitHub + VS Code efficiently.