I would like to check which of my local branch are closed on remote server and remove them from my local list - is there such git
(or any other e.g.bash
) command?
My current flow:
git branch
to list my local branchesgit branch -d branch_name
Any tips/help will be appreciated.
There is
git remote prune origin
That will remove remote branches that track branches on the remote that are no longer there. But it won't delete local branches.
You could clean out locally merged branches using the command suggested in this answer:
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d