If you’re a developer, you already know that GitHub is the go-to platform for version control, open-source collaboration, and managing repositories. Meanwhile, Visual Studio Code (VS Code) has become one of the most versatile code editors for developers across all languages.
The best part? You can seamlessly connect the two — so you can clone repositories, push changes, and manage commits directly from VS Code’s interface.
In this guide, we’ll walk you through everything — from installing Git and connecting your GitHub account, to performing common Git operations inside VS Code.
Step 1: Install Git on Windows 11
Before you can use GitHub inside VS Code, you need to install Git — the version control tool that powers GitHub integration.
- Go to https://git-scm.com/download/win.
- Download and run the installer.
- During installation, keep the default options selected.
- Once installed, verify Git by opening Command Prompt or PowerShell and running:
git --versionYou should see something like:git version 2.xx.x
Tip: Restart your PC after installation to make sure Git integrates properly with VS Code.
Step 2: Install Visual Studio Code
If you haven’t already installed VS Code, get it from the official Microsoft website: https://code.visualstudio.com/
Once installed, open it and make sure it’s up-to-date by navigating to Help → Check for Updates.
Step 3: Install the GitHub Extension in VS Code
VS Code includes basic Git support by default, but to connect directly with your GitHub account, you’ll need the GitHub Pull Requests and Issues extension.
- Open VS Code.
- Go to the Extensions tab (Ctrl + Shift + X).
- In the search bar, type:
GitHub Pull Requests and Issues - Click Install.
- After installation, reload VS Code if prompted.
Now, VS Code is ready to communicate with GitHub repositories directly.
Step 4: Sign In to Your GitHub Account in VS Code
You’ll need to authenticate your GitHub account so that VS Code can securely access your repositories.
- Press Ctrl + Shift + P to open the Command Palette.
- Type:
GitHub: Sign in - Select Sign in to GitHub → then click Allow when your browser opens.
- Log in using your GitHub credentials and authorize VS Code.
- Once authenticated, return to VS Code — you’ll see a confirmation message in the bottom-right corner.
Now your GitHub account is linked!
Step 5: Clone a Repository from GitHub
Once you’re signed in, you can bring your GitHub project into VS Code with just a few clicks.
- Open VS Code and press Ctrl + Shift + P.
- Type:
Git: Clone - Paste the GitHub repository URL (for example:
https://github.com/username/repository.git) - Choose a local folder where you want to save the project.
- Wait for the cloning process to complete.
- When prompted, click Open to launch the project in VS Code.
Tip: You can also click Source Control → Clone Repository directly from the left sidebar.
Step 6: Initialize a New Git Repository
If you’re starting a new project and want to push it to GitHub later:
- Open your project folder in VS Code.
- Click on the Source Control icon on the left sidebar or press Ctrl + Shift + G.
- Click Initialize Repository.
- This will create a new
.gitfolder in your project directory.
Now your local project is ready for Git version control.
Step 7: Commit Your Changes
Once you’ve made code changes, you can easily commit them within VS Code.
- Click on the Source Control tab (the branch icon).
- You’ll see all modified files listed under Changes.
- Hover over a file and click the + icon to stage it.
- Type a commit message in the text box at the top.
- Click the ✔ (checkmark) icon to commit your changes.
Shortcut: Press Ctrl + Enter to commit quickly.
Step 8: Push Your Code to GitHub
Once you’ve committed your changes, push them to your GitHub repository.
- In the Source Control tab, click the “…” (More Actions) icon.
- Select Push.
- If your repository isn’t yet linked, VS Code will prompt you to publish it.
- Click Publish Branch — your project will upload to your GitHub account.
You can now view your code live on GitHub under your repositories.
Step 9: Pull Changes and Sync with Remote Repository
If your project is collaborative, always pull the latest updates before working on new features.
- Open VS Code.
- Click the Source Control icon.
- Click the “…” → select Pull or Sync Changes.
- VS Code will fetch the latest commits from the remote GitHub repo.
Tip: If there are merge conflicts, VS Code will highlight them clearly in your editor.
Step 10: Create and Manage Branches
Working on separate branches is best practice for large projects.
- Click on the branch name (bottom-left corner of VS Code).
- Choose Create New Branch.
- Name it (e.g.,
feature-login-ui). - Make changes, commit, and push the branch:
git push --set-upstream origin feature-login-ui - Later, merge it into the main branch using a Pull Request in GitHub.
Step 11: Use GitHub Features Inside VS Code
The GitHub Pull Requests and Issues extension lets you:
- View open PRs and issues directly in VS Code
- Leave comments on code reviews
- Create pull requests without opening your browser
To access:
- Click the GitHub icon on the sidebar
- Log in (if not already)
- View and manage repositories, issues, and PRs from one place
Wrapping Up
Connecting GitHub with Visual Studio Code makes your development workflow smoother and more efficient. You can manage repositories, commit changes, collaborate with teams, and track progress — all within the same interface.
Once configured, you’ll never need to switch between your browser and editor again for Git operations. With everything unified inside VS Code, you can focus entirely on what matters most — writing great code.