Fork me on GitHub
#emacs
<
2021-03-22
>
teodorlu16:03:41

Hey! Do you have a nice workflow for cleaning up local branches? Care to share? I'd love something like dired's ddddddxy, but from what I can see, Magit doesn't provide a buffer-of-branches that works like this.

ag17:03:54

I don't do that very often; that's why I never bothered about automating this. Basically, I would turn off the read-only mode, copy the names of the branches, paste in a scratch buffer, join the lines, then go back to Magit buffer and press ! ! then run git -D branch-1 branch-2 ... branch-n

👍 3
teodorlu06:03:41

@UJRDALZA5 yup, that would solve my problem! Though I'm using Ivy, and would prefer not dragging in Helm for a Magit mode.

hindol06:03:28

I just tried it. Works without Helm. Not sure why Helm is mentioned. For me, the delete key was x and not k as mentioned.

👀 3
teodorlu08:03:12

Huh, interesting. Thanks for investigating!

teodorlu18:03:59

Great timing, @U051BLM8F! 😄

teodorlu18:03:02

The DOOM Emacs configuration for Magit seems to be using y for yanking stuff, not opening a branch list.

teodorlu18:03:45

The branch "dispatch ground" doesn't seem to list a way for me to do this either. Guess I should learn how to open packages with unconfigured key bindings.

teodorlu18:03:09

For DOOM users:

M-x magit-dispatch y C-v jjj x
This does: 1. Bring up the "other" dispatch menu, that you perhaps didn't know you have (I didn't) 2. y to list refs 3. start visual mode and select 4. Press x to delete selected.

hindol19:03:20

This is what is suggested in the StackExchange thread also. The answer is by none other than https://github.com/tarsius. You are right about y being bound to yank. But I can just type ? in the Magit buffer which is bound to magit-dispatch (in Doom).

👍 3
teodorlu21:03:20

> But I can just type `?` in the Magit buffer which is bound to `magit-dispatch` (in Doom) Ah, thanks. I thought that was the "help menu", I wasn't aware that the key bindings were different from the key bindings in M-x magit-status. Learn something new every day!