Run these commands from the root of your repo.
Function Delete-TagPattern
{
Param(
[Parameter(
Mandatory,
HelpMessage="Enter a pattern for the tags you want to match E.g. `"1.0.0.*`""
)]
[string] $TagPattern
)
$tags = git tag -l $TagPattern
if (-not $tags)
{
Write-Host "No tags match the specified pattern of $TagPattern";
return;
}
Write-Host;
# view the results
$tags
$prompt = Read-Host -Prompt "Would you like to delete these tags (y or n)?"
if ($prompt -eq "y")
{
$tags | ForEach-Object { git push --delete origin $_; git tag -d $_; }
}
}
Delete-TagPattern