Skip to main content
Editing the edit
Source Link
phils
  • 55k
  • 3
  • 90
  • 134

The refs buffer has options to filter to merged branches, however the user interface is a little surprising. From the "References Buffer" 
sectionQuoting C-hig (magit)References Buffer:

‘y’ (‘magit-show-refs’) 
This command lists branches and tags in a dedicated buffer. However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command

 However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command, which binds the following suffix commands and some infix arguments. 

Therefore you can access the show-refsthat transient by running C-u M-x magit-show-refs, ormenu with    yyy in vanilla emacs, or yr yry in Evil mode.1

Once you haveWithin the transient popup open,menu you can refine the view with - M setting the value to the merge target    (E.g develop or    main).

Lastly,Then type y to compareexecute the command, comparing against    HEAD. The refs list you are are left with should only contain merged branches branches.

HighlightNow highlight all the branches you would like to delete, then press k in vanilla Emacs, or x in Evil (magit-delete-thing) to delete the selection.2

Remember, that you can set and save default transient values with    C-x   s and C-x CC-s respectively respectively.


1 or C-uM-x magit-show-refs, or in Evil it's yryr.

2 or M-x magit-delete-thing, or in Evil it's x.

The refs buffer has options to filter to merged branches, however the user interface is a little surprising. From the "References Buffer" section:

‘y’ (‘magit-show-refs’) This command lists branches and tags in a dedicated buffer.

 However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command, which binds the following suffix commands and some infix arguments. 

Therefore you can access the show-refs transient by running C-u M-x magit-show-refs, or with  yy in vanilla emacs, or yr yr in Evil mode.

Once you have the transient popup open, you can refine the view with -M setting the value to the merge target  (E.g develop or  main).

Lastly, type y to compare against  HEAD. The refs list you are left with should only contain merged branches.

Highlight all the branches you would like to delete, then press k in vanilla Emacs, or x in Evil (magit-delete-thing) to delete the selection.

Remember, you can set and save default transient values with  C-x  s and C-x C-s respectively.

The refs buffer has options to filter to merged branches. 
Quoting C-hig (magit)References Buffer:

‘y’ (‘magit-show-refs’) 
This command lists branches and tags in a dedicated buffer. However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command

Therefore you can access that transient menu with  yy1

Within the transient menu you can refine the view with - M setting the value to the merge target  (E.g develop or  main).

Then type y to execute the command, comparing against  HEAD. The refs list you are left with should only contain merged branches.

Now highlight all the branches you would like to delete, then press k to delete the selection.2

Remember that you can set and save default transient values with  C-x s and C-xC-s respectively.


1 or C-uM-x magit-show-refs, or in Evil it's yryr.

2 or M-x magit-delete-thing, or in Evil it's x.

Rewrote the instructions to be more intuitive for more types of Emacs user.
Source Link

The refs buffer has options to filter to merged branches. E.g, however the user interface is a little surprising. From the "References Buffer" section:

‘y’ (‘magit-show-refs’) This command lists branches and tags in a dedicated buffer.

 However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command, which binds the following suffix commands and some infix arguments. 

Therefore you can access the show-refs transient by running yC-u M-x magit-show-refs, or with yyy in vanilla emacs, or -yr yr in Evil mode.

Once you have the transient popup open, you can refine the view with -M setting the value to the merge target (E.g develop or main).

Lastly, type y to compare against HEAD. The refs list you are left with should only contain merged branches.

Then just highlightHighlight all thosethe branches you would like to delete, then press k in vanilla Emacs, or x in Evil (magit-delete-thing) to delete the selection.

Remember, you can set and typesave default transient values with kC-x s and C-x C-s respectively.

The refs buffer has options to filter to merged branches. E.g.:

yy-My

Then just highlight all those branches and type k

The refs buffer has options to filter to merged branches, however the user interface is a little surprising. From the "References Buffer" section:

‘y’ (‘magit-show-refs’) This command lists branches and tags in a dedicated buffer.

 However if this command is invoked again from this buffer or if it is invoked with a prefix argument, then it acts as a transient prefix command, which binds the following suffix commands and some infix arguments. 

Therefore you can access the show-refs transient by running C-u M-x magit-show-refs, or with yy in vanilla emacs, or yr yr in Evil mode.

Once you have the transient popup open, you can refine the view with -M setting the value to the merge target (E.g develop or main).

Lastly, type y to compare against HEAD. The refs list you are left with should only contain merged branches.

Highlight all the branches you would like to delete, then press k in vanilla Emacs, or x in Evil (magit-delete-thing) to delete the selection.

Remember, you can set and save default transient values with C-x s and C-x C-s respectively.

Source Link
phils
  • 55k
  • 3
  • 90
  • 134

The refs buffer has options to filter to merged branches. E.g.:

yy-My

Then just highlight all those branches and type k