Skip to content

Instantly share code, notes, and snippets.

@steviecoaster
Created October 21, 2020 19:26
Show Gist options
  • Save steviecoaster/27f305a000aece62e4c151903f6ade62 to your computer and use it in GitHub Desktop.
Save steviecoaster/27f305a000aece62e4c151903f6ade62 to your computer and use it in GitHub Desktop.
Quick PowerShell function to delete remote git branches
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