Get-GitTag

Gets the tags in a Git repository.

Syntax

Get-GitTag [[-RepoRoot] <String>] [[-Name] <String>] [<CommonParameters>]

Description

The Get-GitTag function returns a list of all the tags in a Git repository.

To get a specific tag, pass its name to the Name parameter. Wildcard characters are supported in the tag name. Only tags that match the wildcard pattern will be returned.

Parameters

Name Type Description Required? Pipeline Input Default Value
RepoRoot String

Specifies which git repository to check. Defaults to the current directory.

false false (Get-Location).ProviderPath
Name String

The name of the tag to return. Wildcards accepted.

false false

Return Values

LibGit2.Automation.TagInfo.

EXAMPLE 1

Get-GitTag

Demonstrates how to get all the tags in a repository.

EXAMPLE 2

Get-GitTag -Name 'LastSuccessfulBuild'

Demonstrates how to return a specific tag. If no tag matches, then $null is returned.

EXAMPLE 3

Get-GitTag -Name '13.8.*' -RepoRoot 'C:\Projects\LibGit2'

Demonstrates how to return all tags that match a wildcard in the given repository.'