Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Delete git merged branch with confirmation
# List dist branch merged | exclude master, HEAD and develop | remove origin/ | delete remote branch asking confirmation
git branch -r --merged | grep -vw "master" | grep -vw "HEAD" | grep -vw "develop" | cut -d "/" -f2 | xargs -p -I {} git push origin :{}

This comment has been minimized.

Copy link

Fabex commented Jul 20, 2012

Usage :

git co develop
git pull --ff-only origin develop
git fetch --all --prune
# run command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.