-
Notifications
You must be signed in to change notification settings - Fork 1
Update‑GitLocalBranch
Updates the specified Git branch by pulling or rebasing from the upstream branch.
Update-GitLocalBranch [-BranchName <String>] [-UpstreamBranchName <String>] [-RemoteName <String>] [-Rebase]
[-ReturnToCurrentBranch] [-OnlyUpdateRemoteTrackingBranch] [-Force]
[-WhatIf] [-Confirm] [<CommonParameters>]
Update-GitLocalBranch [-BranchName <String>] [-UpstreamBranchName <String>] [-RemoteName <String>] [-Rebase]
[-ReturnToCurrentBranch] [-UseExistingTrackingBranch] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
Update-GitLocalBranch [-BranchName <String>] [-UpstreamBranchName <String>] [-RemoteName <String>] [-Rebase]
[-SkipSwitchingBranch] [-OnlyUpdateRemoteTrackingBranch] [-Force]
[-WhatIf] [-Confirm] [<CommonParameters>]
This function checks out the specified local branch and either pulls the latest changes or rebases it with the upstream branch.
Update-GitLocalBranch
Checks out the 'main' branch and pulls the latest changes.
Update-GitLocalBranch -BranchName 'feature-branch'
Checks out the 'feature-branch' and pulls the latest changes.
Update-GitLocalBranch -BranchName 'feature-branch' -UpstreamBranchName 'develop' -Rebase
Checks out the 'feature-branch' and rebases it with the 'develop' branch.
Update-GitLocalBranch -BranchName 'feature-branch' -RemoteName 'upstream'
Checks out the 'feature-branch' and pulls the latest changes from the 'upstream' remote.
Update-GitLocalBranch -BranchName .
Pulls the latest changes into the current branch.
Update-GitLocalBranch -ReturnToCurrentBranch
Checks out the 'main' branch, pulls the latest changes, and switches back to the original branch.
Specifies the local branch name. Default is 'main'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Main
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, the command will not prompt for confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, only the remote tracking branch will be updated.
Type: SwitchParameter
Parameter Sets: Default, Default_SkipSwitchingBranch
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies that the local branch should be rebased with the upstream branch.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the remote name. Default is 'origin'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Origin
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, switches back to the original branch after performing the pull or rebase.
Type: SwitchParameter
Parameter Sets: Default, Default_UseExistingTrackingBranch
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, the function will not switch to the specified branch.
Type: SwitchParameter
Parameter Sets: Default_SkipSwitchingBranch
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the upstream branch name. If not specified the value in BranchName will be used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf specified, only the existing tracking branch will be used to update the local branch.
Type: SwitchParameter
Parameter Sets: Default_UseExistingTrackingBranch
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalsePrompts 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: FalseShows 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: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This function requires Git to be installed and accessible from the command line. The function will check for unstaged or staged changes before proceeding.
- 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