Version control in VS Code
In this tutorial, we will learn how to use the basics of Git version control in Visual Studio Code. For more information about integrated Git support, including how to work with remote repositories, read on in the related resources section below.
Here's the next video we recommend: Customize
Pick another video from the list: Introductory Videos
Video outline
- Install Git
- Open Folder
- File > Open Folder (Ctrl+K Ctrl+O)
- Source Control
- View > Source Control (SCM) (⌃⇧G (Windows, Linux Ctrl+Shift+G))
- Initialize repository
main
is the default branch
- Open the Command Palette.
- View > Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P))
- Rename a branch
- Git: Rename Branch
- File version control status
- U - Untracked file
- A - Added file
- M - Modified file
- Commit file
- Commit ☑️(check mark) button
- Create a branch
- Git: Create Branch
- Diff editor
- Inline View button
- Stage changes
- Stage Changes ➕ button
- Switch branches
- Status bar branch item (lower left)
- Merge branch
- Views and More Actions (...) > Branch > Merge Branch
- Publish branch to GitHub
- Clone repository
- Git: Clone > Clone from URL
Next video
- Customize - Customize VS Code with settings and keyboard shortcuts.
- Introductory Videos - Review the entire list of videos.
Related resources
- Source Control - Read more about integrated Git support.
- Working with GitHub - Create and manage GitHub issues and pull requests.
- Setup Overview - Set up and start using VS Code.