VS Code Git and Productivity

Daily Git workflows, compare views, merge conflicts, and general productivity patterns inside VS Code.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Source Control Basics
Clone repository
Command Palette: Git: Clone

# Clone via built-in Git command.

Open file diff from Source Control
Open Source Control view and click a changed file

# Review changed files directly in diff view.

Stage selected ranges
Select lines in diff editor and use Stage Selected Ranges

# Stage only part of a file from the diff editor.

Sync changes
Status bar sync action or Command Palette: Git: Sync

# Pull and push using the status bar sync action.

## Compare and Merge Conflicts
Select for compare / compare with selected
Explorer context menu: Select for Compare, then Compare with Selected

# Compare arbitrary files in the explorer.

Use merge conflict actions
Open conflicted file and use the conflict action buttons in the editor

# Accept current, incoming, or both changes inline.

Open Timeline view
Explorer / file view: Timeline panel

# See file history and source control timeline.

## Productivity Patterns
Split editor
Windows/Linux: Ctrl+\
macOS: Cmd+\

# Work with multiple files side by side.

Keep editor open
Double-click a tab or use Keep Open

# Pin an editor to stop it from being replaced by preview opens.

Open keyboard shortcuts
Windows/Linux: Ctrl+K Ctrl+S
macOS: Cmd+K Cmd+S

# Customize or inspect shortcuts.

Recommended next

No recommendations yet.