Update a reference
PATCH /repos/:owner/:repo/git/refs/:ref
Parameters
| Name |
Type |
Description |
sha |
string |
Required. The SHA1 value to set this reference to |
force |
boolean |
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. Default: false
|
Input
{
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"force": true
}
Response
{
"ref": "refs/heads/featureA",
"node_id": "MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlQQ==",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA",
"object": {
"type": "commit",
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
}
}