Skip to content

Instantly share code, notes, and snippets.

@wteuber
Last active October 29, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wteuber/e5d8a3bb3f0f2f3d145f47122cc8ab29 to your computer and use it in GitHub Desktop.
Save wteuber/e5d8a3bb3f0f2f3d145f47122cc8ab29 to your computer and use it in GitHub Desktop.
git: prune and delete gone local branches
#!/usr/bin/env bash
git remote prune origin && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment