Created
September 9, 2022 12:27
-
-
Save ajsaraujo/2c526a8de46aecbbd7fac26ea9333b53 to your computer and use it in GitHub Desktop.
Deleting old git branches
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
# Delete old local branches | |
git for-each-ref --format '%(refname:short)' refs/heads | ForEach-Object {git branch $_ -d} | |
# Remove references to old remote branches | |
git remote prune origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References: