Last active
March 21, 2023 09:55
-
-
Save ffMathy/721806d92be6939e7b14681165632909 to your computer and use it in GitHub Desktop.
Cleans up branches that have been merged in to either develop or master remotely.
This file contains hidden or 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
powershell.exe -Command "git fetch --all; git branch --merged | ForEach-Object { $_.Trim() } | Where-Object {$_ -NotMatch \"^\*\"} | Where-Object {-not ( $_ -Like \"*master\" -or $_ -Like \"*main\" -or $_ -Like \"*develop\" )} | ForEach-Object { git branch -d $_ }; git fetch --all; git remote prune origin; git fetch --all" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment