gh-pr-update-branch - Man Page

Update a pull request branch

Synopsis

gh pr update-branch [<number> | <url> | <branch>] [flags]

Description

Update a pull request branch with latest changes of the base branch.

Without an argument, the pull request that belongs to the current branch is selected.

The default behavior is to update with a merge commit (i.e., merging the base branch into the the PR's branch). To reconcile the changes with rebasing on top of the base branch, the --rebase option should be provided.

Options

--rebase

Update PR branch by rebasing on top of latest base branch

Options Inherited from Parent Commands

-R, --repo <[HOST/]OWNER/REPO>

Select another repository using the [HOST/]OWNER/REPO format

Exit Codes

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

Example

$ gh pr update-branch 23
$ gh pr update-branch 23 --rebase
$ gh pr update-branch 23 --repo owner/repo

See Also

gh-pr(1)

Referenced By

gh-pr(1).

Dec 2024 GitHub CLI manual