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
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: Created
{"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"}}