Skip to content

Stop‑GitRebase

viscalyxbot edited this page Sep 30, 2025 · 1 revision

SYNOPSIS

Aborts an ongoing Git rebase operation.

SYNTAX

Stop-GitRebase [[-Path] <String>] [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The Stop-GitRebase command aborts an ongoing rebase operation and restores the branch to its previous state before the rebase started. It uses the Invoke-Git command to execute the git rebase abort operation. This command will only run if the repository is currently in a rebase state.

EXAMPLES

EXAMPLE 1

Stop-GitRebase

Aborts the current rebase operation in the current directory.

EXAMPLE 2

Stop-GitRebase -Path 'C:\repos\MyProject'

Aborts the current rebase operation in the 'C:\repos\MyProject' repository.

PARAMETERS

-Force

Forces the operation to proceed without confirmation prompts when similar to -Confirm:$false.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Path

Specifies the path to the git repository directory. If not specified, uses the current directory.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: (Get-Location).Path
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

CommonParameters

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

INPUTS

None

This function does not accept pipeline input.

OUTPUTS

None

This function does not return any output.

NOTES

This function requires Git to be installed and accessible from the command line. The repository must be in a rebase state for this command to execute.

RELATED LINKS

Clone this wiki locally