-
Notifications
You must be signed in to change notification settings - Fork 1
Get‑GitBranchCommit
Retrieves the commit ID(s) for a specified Git branch.
Get-GitBranchCommit [-BranchName <String>] [<CommonParameters>]
Get-GitBranchCommit [-BranchName <String>] [-First <UInt32>]
[<CommonParameters>]
Get-GitBranchCommit [-BranchName <String>] [-Last <UInt32>]
[<CommonParameters>]
Get-GitBranchCommit [-BranchName <String>] [-Latest] [<CommonParameters>]
Get-GitBranchCommit -From <String> -To <String> [<CommonParameters>]
The Get-GitBranchCommit command retrieves the commit ID(s) for a specified Git branch. It provides options to retrieve the latest commit ID, a specific number of latest commit IDs, or the first X number of commit IDs.
Get-GitBranchCommit -BranchName 'feature/branch'
Retrieves all commit IDs for the 'feature/branch' Git branch.
Get-GitBranchCommit -Latest
Retrieves only the latest commit ID for the current Git branch.
Get-GitBranchCommit -Last 5
Retrieves the 5 latest commit IDs for the current Git branch.
Get-GitBranchCommit -First 3
Retrieves the first 3 commit IDs for the current Git branch.
Get-GitBranchCommit -From 'main' -To 'HEAD'
Retrieves all commit IDs between the main branch and HEAD.
Get-GitBranchCommit -From 'v1.0.0' -To 'v2.0.0'
Retrieves all commit IDs between version tags v1.0.0 and v2.0.0.
Get-GitBranchCommit -From 'abc123' -To 'def456'
Retrieves all commit IDs between two specific commit hashes.
Specifies the name of the Git branch. If not provided, the current branch will be used.
Type: String
Parameter Sets: NoParameter, First, Last, Latest
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the starting reference (commit, branch, tag, or HEAD) for the range. Used with the To parameter to get commits between two references.
Type: String
Parameter Sets: Range
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseRetrieves the specified number of latest commit IDs. The order will be from the newest to the oldest commit.
Type: UInt32
Parameter Sets: Last
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseRetrieves only the latest commit ID.
Type: SwitchParameter
Parameter Sets: Latest
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the ending reference (commit, branch, tag, or HEAD) for the range. Used with the From parameter to get commits between two references.
Type: String
Parameter Sets: Range
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseRetrieves the first X number of commit IDs. The order will be from the oldest to the newest commit.
Type: UInt32
Parameter Sets: First
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
- Assert-GitLocalChange
- Assert-GitRemote
- Assert-IPv4Address
- Clear-AnsiSequence
- ConvertTo-AnsiSequence
- ConvertTo-AnsiString
- ConvertTo-DifferenceString
- ConvertTo-RelativePath
- Disable-CursorShortcutCode
- Get-ClassAst
- Get-ClassResourceAst
- Get-GitBranchCommit
- Get-GitLocalBranchName
- Get-GitRemote
- Get-GitRemoteBranch
- Get-GitTag
- Get-LinkLayerAddress
- Get-ModuleByVersion
- Get-ModuleFileSha
- Get-ModuleVersion
- Get-NumericalSequence
- Get-PSReadLineHistory
- Get-TextOffset
- Install-ModulePatch
- Invoke-Git
- Invoke-PesterJob
- New-GitTag
- New-SamplerGitHubReleaseTag
- Out-Difference
- Pop-VMLatestSnapshot
- Push-GitTag
- Receive-GitBranch
- Remove-GitTag
- Remove-History
- Remove-PSHistory
- Remove-PSReadLineHistory
- Rename-GitLocalBranch
- Rename-GitRemote
- Request-GitTag
- Resolve-DnsName
- Resume-GitRebase
- Send-WakeOnLan
- Split-StringAtIndex
- Start-GitRebase
- Stop-GitRebase
- Switch-GitLocalBranch
- Test-FileHash
- Test-GitLocalChanges
- Test-GitRemote
- Test-GitRemoteBranch
- Test-IPv4Address
- Update-GitLocalBranch
- Update-RemoteTrackingBranch