Update a reference
PATCH
/repos/{owner}/{repo}/git/refs/{ref}- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
- ref stringrequired
ref parameter
Body Params
requiredapplication/jsonobject
force boolean
optionalIndicates 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
requiredThe SHA1 value to set this reference to
Responses
application/json Git Reference object
Response
node_id string
required object objectrequired
object object
requiredsha string
requiredSHA for the reference
Example: 7638417db6d59f3c431d3e1f261cc637155684cd
type string
requiredurl string<uri>
requiredref string
requiredurl string<uri>
requiredapplication/json Validation Error object
Validation failed
documentation_url string
required errors array[object]optional
errors array[object]
optional items object
items object
code string
requiredfield string
optionalindex integer
optionalmessage string
optionalresource string
optionalvalue
optionalmessage string
required