Skip to content

Instantly share code, notes, and snippets.

@leechunhoe
Last active April 6, 2020 01:42
Show Gist options
  • Save leechunhoe/5697245ac3457fdf5df721f15c4594b2 to your computer and use it in GitHub Desktop.
Save leechunhoe/5697245ac3457fdf5df721f15c4594b2 to your computer and use it in GitHub Desktop.
Delete merged/gone local git branches (bash/zsh)
# Delete git branches with status [gone] (bash/zsh)
git branch -v | grep "\[gone\]" | awk 'END {FS="\t"}; {print $1}' | xargs git branch -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment