v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2023-07-147873273.9 MB
git

Update a reference

patch/repos/{owner}/{repo}/git/refs/{ref}

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

refstring required

The name of the fully qualified reference to update. For example, refs/heads/master. If the value doesn't start with refs and have at least two slashes, it will be rejected.

Request body

shastring required

The SHA1 value to set this reference to

forceboolean

Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to false will make sure you're not overwriting work.

Response

Response

refstring required
node_idstring required
urlstring uri required

Example response

{
  "object": {
    "sha": "7638417db6d59f3c431d3e1f261cc637155684cd"
  }
}