CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 05 Sep 2025 13:40:41 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20161114184923
location: https://web.archive.org/web/20161114184923/https://developer.github.com/v3/git/trees/
server-timing: captures_list;dur=0.578314, exclusion.robots;dur=0.020854, exclusion.robots.policy;dur=0.010155, esindex;dur=0.014637, cdx.remote;dur=240.726035, LoadShardBlock;dur=572.964005, PetaboxLoader3.datanode;dur=172.714796, PetaboxLoader3.resolve;dur=73.243670
x-app-server: wwwb-app223
x-ts: 302
x-tr: 852
server-timing: TR;dur=0,Tw;dur=302,Tc;dur=3
set-cookie: wb-p-SERVER=wwwb-app223; 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: Fri, 05 Sep 2025 13:40:44 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: GitHub.com
x-archive-orig-last-modified: Mon, 14 Nov 2016 05:40:40 GMT
x-archive-orig-access-control-allow-origin: *
x-archive-orig-expires: Mon, 14 Nov 2016 18:59:23 GMT
x-archive-orig-cache-control: max-age=600
x-archive-orig-x-github-request-id: 17EB2F24:6309:3856284:582A0733
x-archive-orig-content-length: 41520
x-archive-orig-accept-ranges: bytes
x-archive-orig-date: Mon, 14 Nov 2016 18:49:23 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-sjc3120-SJC
x-archive-orig-x-cache: MISS
x-archive-orig-x-cache-hits: 0
x-archive-orig-x-timer: S1479149363.822181,VS0,VE67
x-archive-orig-vary: Accept-Encoding
x-archive-orig-x-fastly-request-id: e3f43617ab9b5240b76ef9f6d1e4303ee4b991d9
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 14 Nov 2016 18:49:23 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Thu, 23 Jun 2011 02:03:44 GMT", ; rel="prev memento"; datetime="Sun, 14 Aug 2016 22:53:08 GMT", ; rel="memento"; datetime="Mon, 14 Nov 2016 18:49:23 GMT", ; rel="next memento"; datetime="Sat, 04 Feb 2017 21:07:54 GMT", ; rel="last memento"; datetime="Tue, 06 May 2025 18:19: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: ARCHIVEIT-771-QUARTERLY-JOB248887-20161114-00001/ARCHIVEIT-771-QUARTERLY-JOB248887-20161114184331856-00016.warc.gz
server-timing: captures_list;dur=1.047932, exclusion.robots;dur=0.091769, exclusion.robots.policy;dur=0.018079, esindex;dur=0.033479, cdx.remote;dur=60.781166, LoadShardBlock;dur=372.887604, PetaboxLoader3.datanode;dur=180.022635, PetaboxLoader3.resolve;dur=701.812193, load_resource;dur=675.532073
x-app-server: wwwb-app223
x-ts: 200
x-tr: 1291
server-timing: TR;dur=0,Tw;dur=411,Tc;dur=1026
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 Trees | GitHub Developer Guide
Trees
Get a Tree
GET /repos/:owner/:repo/git/trees/:sha
Response
If truncated
is true
, the number of items in the tree
array exceeded our maximum limit. If you need to fetch more items, you can clone the repository and iterate over the Git data locally.
Status: 200 OK
{
"sha": "9fb037999f264ba9a7fc6274d15fa3ae2ab98312",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312",
"tree": [
{
"path": "file.rb",
"mode": "100644",
"type": "blob",
"size": 30,
"sha": "44b4fc6d56897b048c772eb4087f854f46256132",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132"
},
{
"path": "subdir",
"mode": "040000",
"type": "tree",
"sha": "f484d249c660418515fb01c2b9662073663c242e",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e"
},
{
"path": "exec_file",
"mode": "100755",
"type": "blob",
"size": 75,
"sha": "45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057"
}
],
"truncated": false
}
Get a Tree Recursively
GET /repos/:owner/:repo/git/trees/:sha?recursive=1
Response
If truncated
is true
, the number of items in the tree
array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.
Status: 200 OK
{
"sha": "fc6274d15fa3ae2ab983129fb037999f264ba9a7",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/fc6274d15fa3ae2ab983129fb037999f264ba9a7",
"tree": [
{
"path": "subdir/file.txt",
"mode": "100644",
"type": "blob",
"size": 132,
"sha": "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b",
"url": "https://api.github.com/repos/octocat/Hello-World/git/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
}
],
"truncated": false
}
Create a Tree
The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out.
POST /repos/:owner/:repo/git/trees
Parameters
Name | Type | Description |
---|---|---|
tree |
array of object s |
Required. Objects (of path , mode , type , and sha ) specifying a tree structure |
base_tree |
string |
The SHA1 of the tree you want to update with new data. If you don't set this, the commit will be created on top of everything; however, it will only contain your change, the rest of your files will show up as deleted. |
The tree
parameter takes the following keys:
Name | Type | Description |
---|---|---|
path |
string |
The file referenced in the tree |
mode |
string |
The file mode; one of 100644 for file (blob), 100755 for executable (blob), 040000 for subdirectory (tree), 160000 for submodule (commit), or 120000 for a blob that specifies the path of a symlink |
type |
string |
Either blob , tree , or commit
|
sha |
string |
The SHA1 checksum ID of the object in the tree |
content |
string |
The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or tree.sha . |
Input
{
"base_tree": "9fb037999f264ba9a7fc6274d15fa3ae2ab98312",
"tree": [
{
"path": "file.rb",
"mode": "100644",
"type": "blob",
"sha": "44b4fc6d56897b048c772eb4087f854f46256132"
}
]
}
Response
Status: 201 Created
Location: https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7
{
"sha": "cd8274d15fa3ae2ab983129fb037999f264ba9a7",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7",
"tree": [
{
"path": "file.rb",
"mode": "100644",
"type": "blob",
"size": 132,
"sha": "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
}
]
}