Update a pull request branch

Note: Updating the pull request branch with latest upstream changes is currently available for developers to preview. To access this new endpoint during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.lydian-preview+json

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact your GitHub Enterprise site administrator.

Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch.

PUT /repos/:owner/:repo/pulls/:pull_number/update-branch

Input

Name Type Description
expected_head_sha string The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a 422 Unprocessable Entity status. You can use the "List commits on a repository" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref.

Example

{
  "expected_head_sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}

Response

Status: 202 Accepted
{
  "message": "Updating pull request branch.",
  "url": "https://github.com/repos/octocat/Hello-World/pulls/53"
}