Skip to content

Remove‑GitTag

viscalyxbot edited this page Sep 30, 2025 · 1 revision

SYNOPSIS

Removes Git tags from local repository and/or remote repositories.

SYNTAX

Remove-GitTag [-Tag] <String[]> [-Remote <String[]>] [-Local] [-Force] 
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Remove-GitTag command removes Git tags from the local repository and/or one or more remote repositories. It supports removing multiple tags and handling multiple remotes in a single operation.

EXAMPLES

EXAMPLE 1

Remove-GitTag -Tag 'v1.0.0'

Removes the tag 'v1.0.0' from the local repository.

EXAMPLE 2

Remove-GitTag -Tag 'v1.0.0' -Remote 'origin'

Removes the tag 'v1.0.0' from the 'origin' remote repository.

EXAMPLE 3

Remove-GitTag -Tag 'v1.0.0' -Remote 'origin', 'upstream'

Removes the tag 'v1.0.0' from both 'origin' and 'upstream' remote repositories.

EXAMPLE 4

Remove-GitTag -Tag 'v1.0.0' -Local -Remote 'origin'

Removes the tag 'v1.0.0' from both the local repository and the 'origin' remote.

EXAMPLE 5

Remove-GitTag -Tag @('v1.0.0', 'v1.1.0') -Remote 'origin', 'my'

Removes multiple tags from multiple remotes.

PARAMETERS

-Force

Forces the operation to proceed without confirmation prompts when similar to -Confirm:$false.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Local

Specifies that the tag should be removed from the local repository. When neither Remote nor Local is specified, Local is assumed.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Remote

Specifies the remote repository or repositories from which to remove the tag(s). This parameter accepts an array of strings to support removing from multiple remotes.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Tag

Specifies the tag or tags to remove. This parameter is mandatory and accepts an array of strings to support removing multiple tags.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

This function does not accept pipeline input.

OUTPUTS

None

This function does not return any output.

NOTES

This function requires Git to be installed and accessible from the command line. The function will fail if there are any Git errors during tag removal.

When only the Tag parameter is specified, the tag will be removed from the local repository (equivalent to specifying -Local).

RELATED LINKS

Clone this wiki locally