Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/package-deps-hash > getRepoRoot

getRepoRoot() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Finds the root of the current Git repository

Signature:

export declare function getRepoRoot(currentWorkingDirectory: string, gitPath?: string): string;

Parameters

ParameterTypeDescription
currentWorkingDirectorystringThe working directory for which to locate the repository
gitPathstring(Optional) The path to the Git executable

Returns:

string

The full path to the root directory of the Git repository