Last active
May 12, 2022 19:12
-
-
Save awright18/9636e02573a74bc263075996a2d888c5 to your computer and use it in GitHub Desktop.
Clean up local 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
function CleanLocalGitRepo | |
{ | |
git checkout master; git remote update origin --prune; git branch -vv | | |
Select-String -Pattern ": gone]" | | |
% { $_.toString().Trim().Split(" ")[0]} | | |
% {git branch -d $_ } | |
} | |
Set-Alias Get-GitClean CleanLocalGitRepo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment