Skip to main content

Update a reference

PATCH/repos/{owner}/{repo}/git/refs/{ref}
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
owner string
required
repo string
required
ref string
required

ref parameter

Body Params
required
application/jsonobject
force boolean
optional

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.

sha string
required

The SHA1 value to set this reference to

Responses

application/json Git Reference object

Response

node_id string
required
object object
required
sha string
required

SHA for the reference

Example: 7638417db6d59f3c431d3e1f261cc637155684cd

type string
required
url string<uri>
required
ref string
required
url string<uri>
required
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required