Visual Studio Code supports GitHub integration via its built-in Git tools and official extensions. Here’s how to connect your GitHub account to VS Code for smooth workflows.
✅ Prerequisites
- Visual Studio Code installed
- Git installed on your machine (check with
git --version
) - A GitHub account
Step 1: Install the GitHub Extension (Optional but Recommended)
While VS Code has native Git support, the GitHub Pull Requests and Issues extension adds enhanced features.
- Open VS Code
- Go to Extensions panel (
Ctrl+Shift+X
) - Search for GitHub Pull Requests and Issues
- Click Install
Step 2: Sign In to GitHub from VS Code
- Click the Accounts icon in the bottom-left corner of VS Code (or open the Command Palette with
Ctrl+Shift+P
) - Type and select “GitHub: Sign in”
- A browser window opens for GitHub authentication
- Authorize VS Code to access your GitHub account
- Return to VS Code once signed in
Step 3: Clone a GitHub Repository
- Press
Ctrl+Shift+P
, then type and select “Git: Clone” - Paste the GitHub repo URL (e.g.,
https://github.com/username/repo.git
) - Choose a local folder to clone into
- VS Code will open the cloned repo automatically
Step 4: Push Local Changes to GitHub
If you have a local repo initialized:
- Add your remote repository if not set:
git remote add origin https://github.com/username/repo.git
- Use the Source Control panel in VS Code to stage, commit, and push changes
- Use the push button or run:
git push -u origin main
Step 5: Work with Pull Requests & Issues (Using Extension)
- After installing the GitHub Pull Requests and Issues extension, you can:
- Create and review pull requests inside VS Code
- View and manage GitHub issues linked to your repo
- Access these via the GitHub icon on the sidebar
Additional Tips
- Use GitHub Authentication via SSH for passwordless push/pull operations
- Configure Git user info with:
git config --global user.name "Your Name" git config --global user.email "yo*@ex*****.com"
- For private repos, make sure to authenticate properly (via token or SSH keys)
Summary Table
Task | VS Code Action / Command |
---|---|
Install GitHub extension | Extensions panel > Search “GitHub” > Install |
Sign in to GitHub | Command Palette > GitHub: Sign in |
Clone GitHub repo | Command Palette > Git: Clone |
Add remote repository | Terminal: git remote add origin <url> |
Stage, commit, push | Source Control panel or Git commands |
Manage PRs & Issues | GitHub sidebar icon (with extension) |