Created
July 3, 2018 01:55
-
-
Save ctolkien/2bca8a7eac9a4c3cba5ccbbcb45e5ac9 to your computer and use it in GitHub Desktop.
Git Remove Branches Merged Upstream
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 Git-RemoveBranchesMergedUpStream { | |
git fetch -p | git remote prune origin | git branch -vv | | |
select-string ": gone]" | | |
ForEach-Object { $_.Line.Substring(2, $_.Line.IndexOf(' ', 2)) } | | |
ForEach-Object { git branch -d $_ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment