SCM Collapse
A VS Code extension that adds a button to collapse all folders in the Source Control tree view, while keeping change groups (Changes, Staged Changes, Merge Changes) expanded.
Works with any SCM provider — Git, SVN, Mercurial, or any other version control system integrated via VS Code's SCM API.
Features
- One-click folder collapse — Click the collapse button in the SCM title bar to collapse all folder nodes in the tree view
- Groups stay expanded — Top-level change groups like "Changes", "Staged Changes", and "Merge Changes" remain expanded so you can still see which files belong to each group
- Works with all SCM providers — Not limited to Git; works with SVN, Mercurial, or any SCM extension
Usage
- Open the Source Control view (
Ctrl+Shift+G / Cmd+Shift+G)
- Make sure the view is in Tree mode (click "Toggle View Mode" in the SCM title bar if you see a flat list)
- Click the collapse button (⤵) in the SCM title bar
Before
Folders are expanded, making the tree view cluttered:
Changes (3)
├── src/
│ ├── utils/
│ │ └── helper.ts
│ └── main.ts
├── package.json
└── README.md
After
All folders are collapsed, but the "Changes" group stays expanded:
Changes (3)
├── src/
├── package.json
├── README.md
Command
| Command |
Title |
scmCollapse.collapseAll |
SCM: Collapse All Folders |
You can also invoke this command from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
Requirements
- VS Code 1.88.0 or later
- SCM view must be in Tree mode for folder collapsing to have visible effect
Release Notes
1.0.0
Initial release — collapse all folders in the SCM tree view while preserving change group headings.
License
MIT