Created
October 21, 2020 19:26
-
-
Save steviecoaster/27f305a000aece62e4c151903f6ade62 to your computer and use it in GitHub Desktop.
Quick PowerShell function to delete remote git branches
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
function Remove-RemoteGitBranch { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[String] | |
$Branch | |
) | |
process { | |
if ($PSCmdlet.ShouldContinue("$Branch","DELETE remote branch")) { | |
$gitArgs = @('push' | |
'origin' | |
'--delete' | |
$Branch) | |
git @gitArgs | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment