Home Coding & Scripting Setting Up GitHub Integration in Visual Studio Code (VS Code)

Setting Up GitHub Integration in Visual Studio Code (VS Code)

301
0

⭐ 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:

  1. Set up your local Git installation following the steps in the post Installing and Setting Up Git on Windows, macOS, and Linux
  2. 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:

  • .git folder
  • 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

  1. Open any file in the project
  2. Add a small change (example: add a comment)
  3. 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

  1. Open the Source Control panel (left sidebar)
  2. Review the changed files
  3. Type a commit message
  4. Click ✔ Commit
  5. 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.

Previous articlePublic vs Private Repositories on GitHub
Next articleGetting Started with GitHub Codespaces
Heartin Kanikathottu
As a seasoned Cloud and Security Architect, I’ve led transformative initiatives in key roles, including Vice President at Morgan Stanley, Principal Architect at Societe Generale, and Tech Lead & Cloud Security Architect at VMware, among others. I’m also an internationally published author with multiple books available on platforms like Amazon and O'Reilly. Notably, one of my books was recognized as the 8th best cloud computing book of all time in 2020, reflecting the impact of my contributions to the field. With over 15 professional certifications from providers such as Microsoft (Azure), Amazon (AWS), Oracle (Java), Pivotal (Spring), and IBM, I bring a wealth of expertise to my work. Academically, I hold dual Master’s degrees in Cloud Computing and Data Analytics. I’m passionate about sharing knowledge and mentoring others, which is why I actively speak at global technical forums such as Tech Opportunities Fest at Platform Calgary, Google's Kubernetes Meetup, Java User Group, Elasticsearch Meetup, and the Agile India Conference.

LEAVE A REPLY

Please enter your comment!
Please enter your name here