Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshadmand/b6092a870bc5cd452181 to your computer and use it in GitHub Desktop.
Save sshadmand/b6092a870bc5cd452181 to your computer and use it in GitHub Desktop.
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

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