How to remove all merged Git Branches on Windows

Here’s a quick tip on howto remove Git Branches that were already merged (thus not necessary to keep around anymore) locally on Windows, using PowerShell. Assuming that you do have Git for Windows installed. Execute these commands on your own risk. List all merged branches You can list all merged Git Branches by running: 1 git branch --merged Exclude current branch and “main” branch Then we |-pipe it into the following, to exclude the currently selected branch (marked with an asterisk *) and the main branch....

2022-06-21 · 2 min · Andreas Dieckmann