Create a reference

POST {{baseUrl}}/repos/:owner/:repo/git/refs

Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.

Request Body

{"ref"=>"<string>", "sha"=>"<string>", "key"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: Created

{&quot;ref&quot;:&quot;refs/heads/featureA&quot;,&quot;node_id&quot;:&quot;MDM6UmVmcmVmcy9oZWFkcy9mZWF0dXJlQQ==&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/refs/heads/featureA&quot;,&quot;object&quot;:{&quot;type&quot;:&quot;commit&quot;,&quot;sha&quot;:&quot;aa218f56b14c9653891f9e74264a383fa43fefbd&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd&quot;}}