GitHub and VS Code

GitHub and Visual Studio Code

Bring your workflows closer to your code. Learn how Visual Studio Code and GitHub are better together.

Download Visual Studio Code
Free for Windows, macOS, and Linux

Get started with GitHub in Visual Studio Code

Check out our 20-minute tutorial to get the best of GitHub in the editor.

Our top 20 tips and tricks

01

Codespaces

No editor, no problem. Code in a browser with a real VS Code experience, powered by GitHub Codespaces.


02

Clone And Code

You can directly clone a repo from Visual Studio Code. Authenticate with your GitHub account and clone any repo you want. VS Code takes care of setting your remote so you can clone, code and push in no time flat.


03

Publish Your Project

Publish any project directly to GitHub without having to create a repo first. VS Code will create the repo for you and give you control over whether or not it should be public or private.


04

Integrated Source Control View

The source control view tracks your file changes and makes it easy to commit and push those changes. Add a commit message, mention another user in the repo, and click on 'sync changes' in the status bar. This will pull any remote changes down, and push your commits upstream.


05

Branching

From the status bar, you can view all branches and easily switch to another one. From the command palette, you can also checkout another branch, create a new one, or rename a branch. Branch away!


06

Stashing

Temporarily set aside the code changes you already made with a Git stash then get back to them later!


07

Stage Commits

The Source Control view in VS Code lets you stage specific changes only, so you can control what's part of your commit and what's still a WIP (Work In Progress) Then click on ✔️ to make a commit.


08

Merge Your Way

Do you most commonly merge, squash/merge, or rebase/merge? Well, from the GitHub Pull Request and Issues extension, you can choose either merge option.


09

Handle Merge Conflicts

VS Code will recognize merge conflicts, highlight the differences, and make it easy to choose the current change or the incoming change. If you have multiple changes, you can search for 'Merge Conflict' in the command palette and take action on all conflicts.


10

Change Your Diff View

Some people prefer a to see their diff's side-by-side and some prefer an inline view. Get both in VS Code. This setting persists when it's changed so you can set it and forget it.


11

Jump Directly To GitHub

Sometimes you're just knee deep in source code and need to switch over to GitHub. With the GitHub Pull Requests and Issues extension, you can copy a permalink or directly open a permalink in GitHub so you don't lose your place.


12

Create Issues

Do you find yourself putting //TODO comments throughout your code and then forgetting to...do them? With the GitHub Pull Requests and Issues extension, you can make those comments actionable and create GH issues directly from code comments.


13

Manage Issues

View issues from GitHub directly from VS Code. Create custom queries using the same GitHub filter syntax you already know. Your issues organized your way.


14

Request A Review

You can request a review on your PR right from VS Code using the GitHub Pull Requests and Issues extension. Open the PR from the Github Pull Requests explorer and assign away.


15

Keep Track of PRs

Choose the categories you see in the GitHub Pull Requests and Issues tree view. Customize it and make sure you never lose track of PRs again.


16

Code Reviews

View PRs. Check out branches. Add comments. Merge and delete branches from the editor.


17

Time Travel

You can see the Git commit history of a specific file in the Timeline view. Choosing a commit opens up the diff view of the changes from that commit. Easily copy the commit Id or commit message to help you go to important points in your code's


18

GitLens

Get in-line blame annotations and hover information for recent commits, search through commits, visualize and compare commits across branches, and so much more. GitLens is a must-have extension if you're using version control in VS Code.


19

Sign Commits

Use the integrated terminal in VS Code for advanced actions like GPG signing your commits so you can get that big green "verified" badge.


20

Check Under The Hood

Curious to see the Git commands VS Code is doing? You can always peek under the hood. The full output of what VS Code is doing with Git is always available for you in case you need it.


Privacy Policy