Skip to content

Instantly share code, notes, and snippets.

@fidel-karsto
Created November 13, 2019 20:59
Show Gist options
  • Save fidel-karsto/11b06813f0755b7a2eac1bc3318e5aba to your computer and use it in GitHub Desktop.
Save fidel-karsto/11b06813f0755b7a2eac1bc3318e5aba to your computer and use it in GitHub Desktop.
remove all local branches that have been merged and deleted on remote
#!/usr/bin/env bash
# removes all remote deleted branches from local sandbox
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