Simple python script to remove already merged branches in your local and remote (origin by default).
run in your git repo directory
python3 clear_branches.py master ls
shows all branches already merged in master
python3 clear_branches.py master rm
removes all branches already merged in master (local and remote!)
python3 clear_branches.py --filter feature master ls
will only consider branches starting with "feature"
python3 clear_branches.py --filter feature --remote origin2 ls
will only consider branches starting with "filter" from remote "origin2" (and local!)