Last active
September 21, 2020 21:23
-
-
Save jaysephjw/4c58c939c96868033861798c9d57804e to your computer and use it in GitHub Desktop.
git - prune and delete locals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prune remote branches from "origin". Remove --dry-run when confident. | |
git remote prune origin --dry-run; | |
# delete branches with a gone upstream. Remove last pipe to run dry. | |
git branch -vv | grep " \[origin" | grep gone | awk '{print $1}' | xargs -L 1 git branch -D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment