Skip to content

Get-GitRootDirectory

SYNOPSIS

Returns the root directory of a git repository.

SYNTAX

Get-GitRootDirectory [[-RepositoryPath] <String[]>] [<CommonParameters>]

DESCRIPTION

Returns the root directory of a git repository.

EXAMPLES

Example 1

Get-GitRootDirectory

Returns the root directory of the git repository in the current directory.

Example 2

Get-GitRootDirectory -RepositoryPath C:\myRepo\SomeDirectory

Returns the root directory of the git repository in the specified directory. In this case, the root directory is C:\myRepo.

PARAMETERS

-RepositoryPath

The path to the git repository. If not specified, the current directory is used.

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

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

CommonParameters

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

INPUTS

None

OUTPUTS

System.Object

NOTES