Skip to content

New‑GitTag

viscalyxbot edited this page Sep 30, 2025 · 1 revision

SYNOPSIS

Creates a new Git tag locally.

SYNTAX

New-GitTag [-Name] <String> [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The New-GitTag command creates a new Git tag in the local repository. This function supports ShouldProcess functionality for safe operations and includes a Force parameter to bypass confirmation prompts.

EXAMPLES

EXAMPLE 1

New-GitTag -Name 'v1.0.0'

Creates a new Git tag named 'v1.0.0' at the current commit.

EXAMPLE 2

New-GitTag -Name 'release-2023' -Force

Creates a new Git tag named 'release-2023' with the Force parameter, bypassing confirmation prompts when used with -Confirm:$false.

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

-Name

Specifies the name of the Git tag to create. This parameter is mandatory.

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 creation.

RELATED LINKS

Clone this wiki locally