Pressing TAB on a single unstaged file shows or hides details pertaining to that file.

How do I show & hide (toggle) details of all unstaged files at once?

I did come across outline-hide-sublevels via M-x. But I would like to know a key combination to do this in a toggle fashion.

I also typed ? to check the keybinding shortcuts for the magit-status area but could not find an answer.

4 Answers 4


I think you want M-TAB magit-section-cycle-diffs

Cycle the visibility of diff-related sections in the current buffer.


  • Fantastic, I did look through the docs but must have missed this. Thanks very much
    – orion
    Sep 6, 2016 at 1:31
  • @orion Happy to hear that's what you were looking for. If this fully answers your question you can click the checkmark to the left of this answer to "accept" it so others know the question is complete.
    – Jack
    Sep 6, 2016 at 4:30
  • 6
    Every operating system or window manager I have used in the last 15 years has M-TAB bound to window switching... Apr 5, 2018 at 10:10
  • 3
    Actually what I was looking for was M-2 or M-4 from anywhere in the magit buffer to expand and collapse all, which is documented in the link Jack provided
    – orion
    Feb 6, 2019 at 3:57

Another method (if you do not want to change key bindings for the M-TAB solution) is to position your cursor on the line with the section heading, e.g. "Unstaged changes", and press 2 to collapse all changes in that section, or 4 to expand them.

It also works for collapsing/expanding changes per subsection/file.

  • 1
    2 - is exactly I needed, many thanks! Feb 24, 2019 at 13:45
  • In particular, 2 works anywhere within the section.
    – Harald
    Jul 19, 2021 at 18:03

You can use S-TAB (that's shift) to invoke magit-section-cycle-global for a coarse-granularity full-expand and -collapse.


The following works as an replacement to M-tab.

(define-key magit-mode-map [(control >)] 'magit-section-cycle-diffs)

M-tab doesn't work on most MS Windows systems

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.