You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/git/trees.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,31 +13,30 @@ title: Git Trees | GitHub API
13
13
14
14
### Response
15
15
16
-
<%= headers 200 %>
17
-
<%= json :tree %>
18
-
19
16
{{#tip}}
20
17
21
18
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.
22
19
23
20
{{/tip}}
24
21
22
+
<%= headers 200 %>
23
+
<%= json :tree %>
24
+
25
25
## Get a Tree Recursively
26
26
27
27
GET /repos/:owner/:repo/git/trees/:sha?recursive=1
28
28
29
29
### Response
30
30
31
-
<%= headers 200 %>
32
-
<%= json :tree_extra %>
33
-
34
-
35
31
{{#tip}}
36
32
37
33
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.
38
34
39
35
{{/tip}}
40
36
37
+
<%= headers 200 %>
38
+
<%= json :tree_extra %>
39
+
41
40
## Create a Tree
42
41
43
42
The tree creation API will take nested entries as well. If both a
Copy file name to clipboardExpand all lines: content/v3/pulls.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,6 @@ Name | Type | Description
44
44
`sort`|`string`| What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). Default: `created`
45
45
`direction`|`string`| The direction of the sort. Can be either `asc` or `desc`. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`.
Copy file name to clipboardExpand all lines: content/v3/repos/commits.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,13 +37,13 @@ Name | Type | Description
37
37
38
38
### Response
39
39
40
-
<%= headers 200 %>
41
-
<%= json(:full_commit) %>
42
-
43
-
Note: Diffs with binary data will have no 'patch' property. Pass the
40
+
Diffs with binary data will have no 'patch' property. Pass the
44
41
appropriate [media type](/v3/media/#commits-commit-comparison-and-pull-requests) to fetch diff and
45
42
patch formats.
46
43
44
+
<%= headers 200 %>
45
+
<%= json(:full_commit) %>
46
+
47
47
## Compare two commits
48
48
49
49
GET /repos/:owner/:repo/compare/:base...:head
@@ -56,10 +56,10 @@ Both `:base` and `:head` must be branch names in `:repo`. To compare branches ac
56
56
57
57
The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in reverse chronological order.
58
58
59
-
<%= json :commit_comparison %>
60
-
61
59
Pass the appropriate [media type](/v3/media/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.
62
60
61
+
<%= json :commit_comparison %>
62
+
63
63
### Working with large comparisons
64
64
65
65
The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [Commit List API](/v3/repos/commits/#list-commits-on-a-repository) to enumerate all commits in the range.
Copy file name to clipboardExpand all lines: content/v3/repos/contents.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,14 +64,14 @@ Name | Type | Description
64
64
65
65
The response will be an array of objects, one object for each item in the directory.
66
66
67
-
<%= headers 200 %>
68
-
<%= json :directory_content %>
69
-
70
-
Note: When listing the contents of a directory, submodules have their "type"
67
+
When listing the contents of a directory, submodules have their "type"
71
68
specified as "file". Logically, the value *should* be "submodule". This behavior
72
69
exists in API v3 [for backwards compatibility purposes](https://github.com/github/developer.github.com/commit/1b329b04cece9f3087faa7b1e0382317a9b93490).
73
70
In the next major version of the API, the type will be returned as "submodule".
74
71
72
+
<%= headers 200 %>
73
+
<%= json :directory_content %>
74
+
75
75
### Response if content is a symlink
76
76
77
77
If the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the API responds with the content of the file (in the [format shown above](#response-if-content-is-a-file)).
@@ -83,14 +83,14 @@ Otherwise, the API responds with an object describing the symlink itself:
83
83
84
84
### Response if content is a submodule
85
85
86
-
<%= headers 200 %>
87
-
<%= json :submodule_content %>
88
-
89
86
The `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository.
90
87
Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit.
91
88
92
89
If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.
0 commit comments