Skip to content

Instantly share code, notes, and snippets.

@xinbinhuang
Last active November 1, 2019 20:37
Show Gist options
  • Save xinbinhuang/6501a4778cb00ec59f57e482a5938c32 to your computer and use it in GitHub Desktop.
Save xinbinhuang/6501a4778cb00ec59f57e482a5938c32 to your computer and use it in GitHub Desktop.
Git housekeeping: clean up local branches. Details: https://erikaybar.name/git-deleting-old-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