git branch -d branchname
git branch -D branchname
Remove no longer existing references git-fetch
Before fetching, remove any remote-tracking references that no longer exists. git
git fetch origin --prune
make sure your local is updated with origin:
git fetch origin
List merged branches stackoverflow
git branch --merged
In this scenario, develop
and master
are important
git branch --merged| egrep -v "(^\*|master|develop)"
In this scenario, develop
and master
are important
git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d