Skip to content

Test‑GitRemoteBranch

viscalyxbot edited this page Sep 30, 2025 · 1 revision

SYNOPSIS

Tests if a remote branch exists in a Git repository.

SYNTAX

Default (Default)

Test-GitRemoteBranch [[-RemoteName] <String>] [<CommonParameters>]

Name

Test-GitRemoteBranch [-RemoteName] <String> [[-Name] <String>] 
 [<CommonParameters>]

DESCRIPTION

The Test-GitRemoteBranch command checks if a specified branch exists in a remote Git repository.

EXAMPLES

EXAMPLE 1

Test-GitRemoteBranch -RemoteName "origin" -Name "feature/branch"

This example tests if the branch "feature/branch" exists in the remote repository named "origin".

PARAMETERS

-Name

Specifies the name of the branch to check.

Type: String
Parameter Sets: Name
Aliases:

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

-RemoteName

Specifies the name of the remote repository.

Type: String
Parameter Sets: Default
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: Name
Aliases:

Required: True
Position: 1
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

System.Boolean

Returns $true if the remote branch exists, otherwise $false.

NOTES

RELATED LINKS

Clone this wiki locally