Visual Git Interface
VS Code has powerful built-in Git support, providing a graphical interface while keeping command-line power available.
Source Control Panel
Click the Source Control icon (third from top) or press Ctrl+Shift+G.
Key Features
- See changed files at a glance
- Stage files with one click
- Diff viewer shows changes side-by-side
- Commit with built-in message editor
- Branch management
- Merge conflict resolution
Making Commits in VS Code
- Make changes to files
- Open Source Control panel
- Click "+" next to files to stage
- Enter commit message in text box
- Click checkmark to commit
Viewing Changes
Click any file in Source Control to see diff. Changes highlighted with colors.
Branch Management
Bottom left shows current branch. Click to:
- Switch branches
- Create new branch
- Merge branches
Resolving Conflicts
VS Code highlights merge conflicts with options:
- Accept Current Change
- Accept Incoming Change
- Accept Both Changes
- Compare Changes
Extensions
Enhance Git experience:
- GitLens: Advanced Git visualization
- Git Graph: Visual commit history
- Git History: Browse file history
Terminal Integration
Press Ctrl+` for integrated terminal. Best of both worlds—GUI and command line!
Next: Command Interface
VS Code enhances your workflow. Next, learn GitHub CLI for even more command-line power.