Get-GitCommit

Gets the sha-1 ID for specific changes in a Git repository.

Syntax

Get-GitCommit [-RepoRoot <String>] [<CommonParameters>]
Get-GitCommit -Revision <String> [-RepoRoot <String>] [<CommonParameters>]

Description

The Get-GitCommit gets all the commits in a repository, from most recent to oldest.

To get a commit for a specific named revision, e.g. HEAD, a branch, a tag), pass the name to the Revision parameter.

To get the commit of the current checkout, pass HEAD to the Revision parameter.

Parameters

Name Type Description Required? Pipeline Input Default Value
Revision String

A named revision to get, e.g. HEAD, a branch name, tag name, etc.

To get the commit of the current checkout, pass HEAD.

true false
RepoRoot String

The path to the repository. Defaults to the current directory.

false false