Visual Studio Code Version Control


Visual Studio Code has integrated source control and includes Git support in-the-box. Many other source control providers are available through extensions on the VS Code Marketplace.

Git Support

Visual Studio Code ships with a Git source control manager (SCM) extension. Most of the source control UI and workflows are common across other SCM extensions, so reading about the Git support will help you understand how to use another provider.

Setting up a Repository

Cloning a Repository

You can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette or by using the Clone Repository button in the Source Control view available when you have no folder open.

Enter the repository URL you want to clone.

Click on the Clone from URL and select the folder for Repository Location. It will start cloning, once cloning is completed and you can open it.

GitHub Extension

Using GitHub with Visual Studio Code lets you share your source code and collaborate with others. GitHub integration is provided through the GitHub Pull Requests and Issues extension.

Branches and Tags

You can create and checkout branches directly within VS code through the Git: Create Branch and Git: Checkout to commands in the Command Palette (Ctrl+Shift+P).