Skip to content

Instantly share code, notes, and snippets.

@y16ra
Created April 5, 2023 02:30
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 y16ra/081b33f928dc7483fa249d47f1a50f35 to your computer and use it in GitHub Desktop.
Save y16ra/081b33f928dc7483fa249d47f1a50f35 to your computer and use it in GitHub Desktop.
Delete all branches that do not exist in the remote branch
[alias]
clean-branch = !git fetch -p | git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D
@y16ra
Copy link
Author

y16ra commented Apr 5, 2023

Usage

git clean-branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment