CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Mon, 01 Sep 2025 03:17:10 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20131121083509
location: https://web.archive.org/web/20131121083509/https://developer.github.com/v3/git/refs
server-timing: captures_list;dur=0.490896, exclusion.robots;dur=0.018857, exclusion.robots.policy;dur=0.009976, esindex;dur=0.011936, cdx.remote;dur=84.957574, LoadShardBlock;dur=187.987901, PetaboxLoader3.datanode;dur=49.064841, PetaboxLoader3.resolve;dur=57.963833
x-app-server: wwwb-app222
x-ts: 302
x-tr: 297
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app222; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 01 Sep 2025 03:17:11 GMT
content-type: text/html
x-archive-orig-server: GitHub.com
x-archive-orig-last-modified: Wed, 20 Nov 2013 21:52:55 GMT
x-archive-orig-expires: Thu, 21 Nov 2013 08:45:09 GMT
x-archive-orig-cache-control: max-age=600
x-archive-orig-content-length: 20382
x-archive-orig-accept-ranges: bytes
x-archive-orig-date: Thu, 21 Nov 2013 08:35:09 GMT
x-archive-orig-via: 1.1 varnish
x-archive-orig-age: 0
x-archive-orig-connection: close
x-archive-orig-x-served-by: cache-v43-ASH
x-archive-orig-x-cache: MISS
x-archive-orig-x-cache-hits: 0
x-archive-orig-vary: Accept-Encoding
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 21 Nov 2013 08:35:09 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 23 Jun 2011 02:03:33 GMT", ; rel="prev memento"; datetime="Fri, 01 Nov 2013 10:16:24 GMT", ; rel="memento"; datetime="Thu, 21 Nov 2013 08:35:09 GMT", ; rel="next memento"; datetime="Tue, 31 Dec 2013 23:54:25 GMT", ; rel="last memento"; datetime="Wed, 23 Apr 2025 22:02:47 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: alexa20131121-20/51_37_20131121083257_crawl101.arc.gz
server-timing: captures_list;dur=0.761479, exclusion.robots;dur=0.026349, exclusion.robots.policy;dur=0.013810, esindex;dur=0.016209, cdx.remote;dur=28.081518, LoadShardBlock;dur=136.768233, PetaboxLoader3.datanode;dur=131.948620, PetaboxLoader3.resolve;dur=112.949573, load_resource;dur=156.784024
x-app-server: wwwb-app222
x-ts: 200
x-tr: 404
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
Git Refs | GitHub API
References API
Get a Reference
GET /repos/:owner/:repo/git/refs/:ref
The ref
in the URL must be formatted as heads/branch
, not just branch
. For example, the call to get the data for a branch named skunkworkz/featureA
would be:
GET /repos/:owner/:repo/git/refs/heads/skunkworkz/featureA
Response
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"ref": "refs/heads/sc/featureA",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/sc/featureA",
"object": {
"type": "commit",
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
}
}
Get all References
GET /repos/:owner/:repo/git/refs
This will return an array of all the references on the system, including
things like notes and stashes if they exist on the server. Anything in
the namespace, not just heads
and tags
, though that would be the
most common.
You can also request a sub-namespace. For example, to get all the tag references, you can call:
GET /repos/:owner/:repo/git/refs/tags
For a full refs listing, you’ll get something that looks like:
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
[
{
"ref": "refs/heads/master",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/master",
"object": {
"type": "commit",
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
}
},
{
"ref": "refs/heads/gh-pages",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/gh-pages",
"object": {
"type": "commit",
"sha": "612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac"
}
},
{
"ref": "refs/tags/v0.0.1",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/tags/v0.0.1",
"object": {
"type": "tag",
"sha": "940bd336248efae0f9ee5bc7b2d5c985887b16ac",
"url": "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac"
}
}
]
Create a Reference
POST /repos/:owner/:repo/git/refs
Parameters
Name | Type | Description |
---|---|---|
ref |
type |
The name of the fully qualified reference (ie: refs/heads/master ). If it doesn’t start with ‘refs’ and have at least two slashes, it will be rejected. |
sha |
type |
The SHA1 value to set this reference to |
Input
{
"ref": "refs/heads/master",
"sha": "827efc6d56897b048c772eb4087f854f46256132"
}
Response
Status: 201 Created
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"ref": "refs/heads/sc/featureA",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/sc/featureA",
"object": {
"type": "commit",
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
}
}
Update a Reference
PATCH /repos/:owner/:repo/git/refs/:ref
Parameters
Name | Type | Description |
---|---|---|
sha |
type |
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
Status: 200 OK
Location: https://api.github.com/git/:owner/:repo/commit/:sha
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
{
"ref": "refs/heads/sc/featureA",
"url": "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/sc/featureA",
"object": {
"type": "commit",
"sha": "aa218f56b14c9653891f9e74264a383fa43fefbd",
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
}
}
Delete a Reference
DELETE /repos/:owner/:repo/git/refs/:ref
Example: Deleting a branch:
DELETE /repos/octocat/Hello-World/git/refs/heads/feature-a
Example: Deleting a tag:
DELETE /repos/octocat/Hello-World/git/refs/tags/v1.0
Response
Status: 204 No Content
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
This website is a public GitHub repository. Please help us by forking the project and adding to it.