Link

Get-TfsGitCommit

Gets information from one or more Git commits in a remote repository.


Table of Contents

  1. Syntax
  2. Parameters
  3. Inputs
  4. Outputs
  5. Related Links

Syntax

Get by commit SHA

Get-TfsGitCommit
    [-Commit] <object>
    -Repository <object>
    [-Collection <object>]
    [-IncludeWorkItems]
    [-Project <object>]
    [-Server <object>]

Get by tag

Get-TfsGitCommit
    -Repository <object>
    -Tag <string>
    [-Author <string>]
    [-Collection <object>]
    [-Committer <string>]
    [-CompareVersion <GitVersionDescriptor>]
    [-ExcludeDeletes]
    [-FromCommit <string>]
    [-FromDate <DateTime>]
    [-IncludeLinks]
    [-IncludePushData]
    [-IncludeUserImageUrl]
    [-IncludeWorkItems]
    [-ItemPath <string>]
    [-Project <object>]
    [-Server <object>]
    [-ShowOldestCommitsFirst]
    [-Skip <int>]
    [-ToCommit <string>]
    [-ToDate <DateTime>]
    [-Top <int>]

Get by branch

Get-TfsGitCommit
    -Branch <string>
    -Repository <object>
    [-Author <string>]
    [-Collection <object>]
    [-Committer <string>]
    [-CompareVersion <GitVersionDescriptor>]
    [-ExcludeDeletes]
    [-FromCommit <string>]
    [-FromDate <DateTime>]
    [-IncludeLinks]
    [-IncludePushData]
    [-IncludeUserImageUrl]
    [-IncludeWorkItems]
    [-ItemPath <string>]
    [-Project <object>]
    [-Server <object>]
    [-ShowOldestCommitsFirst]
    [-Skip <int>]
    [-ToCommit <string>]
    [-ToDate <DateTime>]
    [-Top <int>]

Search commits

Get-TfsGitCommit
    -Repository <object>
    [-Author <string>]
    [-Collection <object>]
    [-Committer <string>]
    [-CompareVersion <GitVersionDescriptor>]
    [-ExcludeDeletes]
    [-FromCommit <string>]
    [-FromDate <DateTime>]
    [-IncludeLinks]
    [-IncludePushData]
    [-IncludeUserImageUrl]
    [-IncludeWorkItems]
    [-ItemPath <string>]
    [-Project <object>]
    [-Server <object>]
    [-ShowOldestCommitsFirst]
    [-Skip <int>]
    [-ToCommit <string>]
    [-ToDate <DateTime>]
    [-Top <int>]

[Go to top]

Parameters

-Author

Limits the search to commits authored by this user.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Branch

Specifies the branch name of the commit to return.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Collection (Aliases: Organization)

Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL. For more details, see the Get-TfsTeamProjectCollection cmdlet. When omitted, it defaults to the connection set by Connect-TfsTeamProjectCollection (if any).

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Commit

Specifies the hash (SHA) of the commit to return.

Type object
Position 0
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Committer

Limits the search to commits committed by this user.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-CompareVersion

Type GitVersionDescriptor
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-ExcludeDeletes

Prevents deleted items from being included in the results.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-FromCommit

Specifies the “commit-ish” to start the search from.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-FromDate

Specifies the date and time of the commit to start the search from.

Type DateTime
Position (Named)
Default Value 1/1/0001 12:00:00 AM
Accept pipeline input False
Accept wildcard characters False

-IncludeLinks

Includes links to related resources in the results.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-IncludePushData

Includes push data in the results.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-IncludeUserImageUrl

Includes the user’s image URL in the results.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-IncludeWorkItems

Includes links to related work items in the results.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-ItemPath

Limits the search to commits that affect this path.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Project

Specifies the name of the Team Project, its ID (a GUID), or a Microsoft.TeamFoundation.Core.WebApi.TeamProject object to connect to. When omitted, it defaults to the connection set by Connect-TfsTeamProject (if any). For more details, see the Get-TfsTeamProject cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Repository

Specifies the target Git repository. Valid values are the name of the repository, its ID (a GUID), or a Microsoft.TeamFoundation.SourceControl.WebApi.GitRepository object obtained by e.g. a call to Get-TfsGitRepository. When omitted, defaults to the team project name (i.e. the default repository).

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input True (byvalue)
Accept wildcard characters False

-Server

Specifies the URL to the Team Foundation Server to connect to, a TfsConfigurationServer object (Windows PowerShell only), or a VssConnection object. When omitted, it defaults to the connection set by Connect-TfsConfiguration (if any). For more details, see the Get-TfsConfigurationServer cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-ShowOldestCommitsFirst

Sorts the results from oldest to newest commit.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Skip

Type int
Position (Named)
Default Value 0
Accept pipeline input False
Accept wildcard characters False

-Tag

Specifies the tag name of the commit to return.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-ToCommit

Specifies the “commit-ish” to end the search at.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-ToDate

Specifies the date and time of the commit to end the search at.

Type DateTime
Position (Named)
Default Value 1/1/0001 12:00:00 AM
Accept pipeline input False
Accept wildcard characters False

-Top

Specifies the maximum number of commits to return.

Type int
Position (Named)
Default Value 0
Accept pipeline input False
Accept wildcard characters False

Inputs

System.Object

Specifies the target Git repository. Valid values are the name of the repository, its ID (a GUID), or a Microsoft.TeamFoundation.SourceControl.WebApi.GitRepository object obtained by e.g. a call to Get-TfsGitRepository. When omitted, defaults to the team project name (i.e. the default repository).

Outputs

Microsoft.TeamFoundation.SourceControl.WebApi.GitCommitRef