🔀 Lesson 9 of 40 Version Control Beginner

Git & Source Control with VS Code

VS Code has Git built in — no plugin required. This lesson walks through staging, committing, branching, merging, and resolving conflicts all from within the editor.

22% complete

1The Source Control View

Click the Git icon in the Activity Bar (Ctrl+Shift+G) to open Source Control. Changed files are listed under Changes. Stage individual files with the + icon, or stage all with Stage All. Type a commit message and press Ctrl+Enter to commit.

2Branching from VS Code

Click the branch name in the Status Bar to see a list of all branches. Type a new name to create one, or select an existing branch to check it out. You can also push the new branch to the remote directly from the same menu.

Terminal — common Git commands
git checkout -b feature/login
git merge main
git push --set-upstream origin feature/login

3Viewing Diffs

Click any changed file in the Source Control view to open a side-by-side diff. Use the arrow buttons to move between changes. Stage individual hunks with the gutter icons — you don't have to stage entire files.

4Resolving Merge Conflicts

When a merge conflict occurs, VS Code highlights each conflict with inline labels: Accept Current Change, Accept Incoming Change, Accept Both, and Compare Changes. Use the 3-way merge editor (Resolve in Merge Editor) for complex conflicts.

5GitLens Extension

The GitLens extension supercharges built-in Git: inline blame annotations, file history, commit graph, code authorship, and compare-with-previous for any line. It's free and one of the most-installed extensions in the marketplace.

💡 Tip: Run Ctrl+Shift+G G to open the GitLens Commit Graph — a visual timeline of your entire repo history.

All 40 Lessons
Pick any lesson to jump straight to it.
L01
Getting Started with VS Code
FoundationBeginner
→
L02
The VS Code Interface & Layout
FoundationBeginner
→
L03
Installing & Managing Extensions
ExtensionsBeginner
→
L04
Keyboard Shortcuts & Command Palette
ProductivityBeginner
→
L05
Settings, Themes & Customization
CustomizationBeginner
→
L06
IntelliSense & Code Completion
Editor FeaturesBeginner
→
L07
Integrated Terminal Mastery
ProductivityBeginner
→
L08
Search, Find & Replace Across Files
Editor FeaturesBeginner
→
L09
Git & Source Control with VS Code
Version ControlBeginner
→
L10
Snippets & Emmet Abbreviations
ProductivityBeginner
→
L11
GitHub Copilot — Getting Started
AI & CopilotIntermediate
→
L12
Copilot Chat & Inline Ask
AI & CopilotIntermediate
→
L13
JavaScript & TypeScript Development
LanguagesIntermediate
→
L14
Python Development in VS Code
LanguagesIntermediate
→
L15
Debugging Like a Pro
DebuggingIntermediate
→
L16
Linting, Formatting & ESLint
Code QualityIntermediate
→
L17
Multi-Cursor Editing & Refactoring
Editor FeaturesIntermediate
→
L18
Workspaces & Multi-Root Projects
WorkspaceIntermediate
→
L19
Tasks, Build Systems & npm Scripts
WorkflowIntermediate
→
L20
Testing with Jest, Vitest & Pytest
TestingIntermediate
→
L21
React Development Workflow
Web DevIntermediate
→
L22
Node.js & Express in VS Code
BackendIntermediate
→
L23
Docker & Dev Containers
DevOpsIntermediate
→
L24
Live Share — Real-Time Collaboration
CollaborationIntermediate
→
L25
Jupyter Notebooks in VS Code
Data ScienceIntermediate
→
L26
REST Client & API Testing
API DevIntermediate
→
L27
SSH Remote Development
Remote DevIntermediate
→
L28
WSL 2 Integration on Windows
Remote DevIntermediate
→
L29
Advanced Debugging: Breakpoints & Watch
DebuggingAdvanced
→
L30
Copilot Agent Mode — Agentic Workflows
AI & CopilotAdvanced
→
L31
Profile & Performance Optimisation
PerformanceAdvanced
→
L32
GitHub Actions & CI/CD Integration
DevOpsAdvanced
→
L33
Custom Keybindings & Key Maps
CustomizationAdvanced
→
L34
Settings Sync & Dotfiles Management
WorkflowAdvanced
→
L35
Language Server Protocol (LSP) Explained
InternalsAdvanced
→
L36
Rust Development in VS Code
LanguagesAdvanced
→
L37
Go Development in VS Code
LanguagesAdvanced
→
L38
GitHub Codespaces & vscode.dev
Remote DevExpert
→
L39
Writing Your First VS Code Extension
Extension DevExpert
→
L40
Pro VS Code Workflow & Mastery
MasteryExpert
→