2

I just learned about magit-remote-prune for cleaning up stale remote branch.

For merged local branches, I often use git branch | git branch -d to clean up. Is there a way to do that in Magit; conveniently listing merged local branches, and selecting them for deletion?

4

git branch lists all local branches as well as *, so the command you have given cannot actually be used to delete all merged branches and nothing else. Or if actually does do it while printing some error messages in the process, then I would never-the-less strongly advice against doing that.

Magit does not have a "delete all merged branches" command.

You can however list all branches merged into master using C-u y - M o master RET (or C-u y - m if master is checked out). Then you can mark these branches using the region and delete them using k.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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