Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Advanced Git Cheatsheet
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@sshadmand
Copy link
Author

sshadmand commented Aug 22, 2014

First run prune to delink all local branches without a remote branch. Then the second command will remove local branches wthout remote link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment