TIL – Magit References Buffer

Discovering the Magit references buffer that has been hiding in plain sight.

Faced with the task of cleaning up old git branches, I needed a streamlined way to review them in Magit. Now, my Magit-fu is often lacking and I've not yet encountered a convenient way to browse branches. Searching through the help popups in Magit, nothing stood out to me. Thankfully there was a nice concise answer on StackExchange:

Use magit-show-refs, bound by default to y.

–Kyle Meyer

The feature I was searching for has been hiding in plain sight all along, as the obscurely named Show Refs. When Magit is active, pressing y displays a buffer showing all local branches and remote refs.

A screenshot of Emacs showing the magit-refs buffer
The magit-refs buffer

The references buffer is incredible - so much more than I was looking for, and ideal for the task in hand. For all the local branches, it shows how the local branch and its remote tracking branch have diverged from each other. Any branch can be expanded to show the local commits and pressing RET on a commit displays that commit in another buffer.

emacs  magit  til