In this article we will go through simple example for Tree API from GitHub REST API using Java. In earlier article we went through content API. Here is the link for the same.
Example in this article
- Get branches list using branches REST end point.
- Fetch Tree REST URL from branches response for ‘develop’ branch.
- Call Tree REST endpoint with recursive parameter & get list of all files recursively & print files names & sizes.
GitHub Branches & Tree API
You can find documentation here for Branches API & Tree API.
- Base URL for GitHub API – https://api.github.com
- Path for Branches API – /repos/:owner/:repo/branches/:branch (GET)
- Path for Branches API – /repos/:owner/:repo/git/trees/:tree_sha (GET)
- Parameter – recursive (Set to 1 to indicate to get files recursively)
Test Repo Web URL = https://github.com/Ravikharatmal/test
- “:owner” will be “RaviKharatmal”
- “:repo” will be “test”.
- “:branch” as “develop” so that we will get files from “develop” branch.
- “:tree_sha” will be received in response of branches API, so use that value.
Lets code
In earlier article for Content API, we used Spring Framework’s RestTemplate. For this example, we will use Apache commons HTTP Client library with Apache Fluent httpcomponents library. We will still use GSON for JSON parsing. In this article we will just fetch file metadata. To get file content you can refer Content API.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.5</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.9</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>fluent-hc</artifactId> <version>4.5.9</version> </dependency> |
Here is the Java code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
package com.itsallbinary.gitapi; import java.io.IOException; import java.net.URISyntaxException; import java.util.List; import java.util.Map; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.fluent.Content; import org.apache.http.client.fluent.Request; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class GitHubAPI_GetTree_Example { private static Gson gson; public static void main(String[] args) throws IOException, URISyntaxException { // To print response JSON, using GSON. Any other JSON parser can be used here. gson = new GsonBuilder().setPrettyPrinting().create(); /* * Call GitHub branches API REST end point & get JSON response. This response * will also provide URL with treeSha for Tree REST endpoint. */ Map jsonMap = makeRESTCall("https://api.github.com/repos/RaviKharatmal/test/branches/develop"); System.out.println( "Branches API Response = \n<API RESPONSE START>\n " + gson.toJson(jsonMap) + "\n<API RESPONSE END>\n"); /* * Fetch Tree API REST endpoint URL from above response. We will use gson tree * traversing methods to get this. * * Path in JSON = root > commit > commit > tree > url */ String treeApiUrl = gson.toJsonTree(jsonMap).getAsJsonObject().get("commit").getAsJsonObject().get("commit") .getAsJsonObject().get("tree").getAsJsonObject().get("url").getAsString(); System.out.println("TREE API URL = " + treeApiUrl + "\n"); /* * Now call GitHub Tree API to get tree of files with metadata. Added recursive * parameter to get all files recursively. */ Map jsonTreeMap = makeRESTCall(treeApiUrl + "?recursive=1"); System.out.println( "TREE API Response = \n<API RESPONSE START>\n " + gson.toJson(jsonMap) + "\n<API RESPONSE END>\n"); // Get tree list & iterate over it. System.out.println("Directory & files list :"); for (Object obj : ((List) jsonTreeMap.get("tree"))) { Map fileMetadata = (Map) obj; // Type tree will be directory & blob will be file. Print files & directory // list with file sizes. if (fileMetadata.get("type").equals("tree")) { System.out.println("Directory = " + fileMetadata.get("path")); } else { System.out.println( "File = " + fileMetadata.get("path") + " | Size = " + fileMetadata.get("size") + " Bytes"); } } } /** * This method will make a REST GET call for this URL using Apache http client & * fluent library. * * Then parse response using GSON & return parsed Map. */ private static Map makeRESTCall(String restUrl) throws ClientProtocolException, IOException { Content content = Request.Get(restUrl).execute().returnContent(); String jsonString = content.asString(); System.out.println("content = " + jsonString); // To print response JSON, using GSON. Any other JSON parser can be used here. Map jsonMap = gson.fromJson(jsonString, Map.class); return jsonMap; } } |
Here is the output of above program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
content = {"name":"develop","commit":{"sha":"665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2","node_id":"MDY6Q29tbWl0MTk1NTA3Mzg5OjY2NWY5NjNiYjQ5YWNjMGFiOGUxZmMwMGRhZmMzZTE1ZjQ4Y2Q3YTI=","commit":{"author":{"name":"Ravi Kharatmal","email":"ravi.kharatmal@gmail.com","date":"2019-08-25T05:31:54Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2019-08-25T05:31:54Z"},"message":"Create SomeFile.txt","tree":{"sha":"411248a03683054356cf1207d4502969e6a64eef","url":"https://api.github.com/repos/Ravikharatmal/test/git/trees/411248a03683054356cf1207d4502969e6a64eef"},"url":"https://api.github.com/repos/Ravikharatmal/test/git/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJdYh1KCRBK7hj4Ov3rIwAAdHIIAI7ct9R8ep1IkuIF4rb7WMTz\nxUcr+LqzFKt8XXjNo0En0T6pdZor4bT7QkilDJ5u4ic0RRPYDyI2MtC61ICTSpVc\n9HE8SpAHsaxLp+2z1/OtZXuCAEnp8TUSLUxqlUmvzpcP18oRJt/9EGXKt9FtLEyZ\nst+cfPdSC6e0CefVfRX1y/7yOb2J5nLqlwz7lphq7T8EPiA+wo50QOiMVsKba5no\ncGWjVzGwujSNeYN6wk7LYpAZyGnQwwTgMF6YkhWulRfimFIzKPIJuo7mzqpimOWK\ne67+xvisNWZTC2zUGVLBZxXsGfSI6Qa1K5c4AwxErzvIrwjuNY18QKpKq+lhAbg=\n=SvUr\n-----END PGP SIGNATURE-----\n","payload":"tree 411248a03683054356cf1207d4502969e6a64eef\nparent 8e760da70c93f05aa8799f897ac0f44a94dfb540\nauthor Ravi Kharatmal <ravi.kharatmal@gmail.com> 1566711114 -0700\ncommitter GitHub <noreply@github.com> 1566711114 -0700\n\nCreate SomeFile.txt"}},"url":"https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2","html_url":"https://github.com/Ravikharatmal/test/commit/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2","comments_url":"https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2/comments","author":{"login":"Ravikharatmal","id":6250135,"node_id":"MDQ6VXNlcjYyNTAxMzU=","avatar_url":"https://avatars0.githubusercontent.com/u/6250135?v=4","gravatar_id":"","url":"https://api.github.com/users/Ravikharatmal","html_url":"https://github.com/Ravikharatmal","followers_url":"https://api.github.com/users/Ravikharatmal/followers","following_url":"https://api.github.com/users/Ravikharatmal/following{/other_user}","gists_url":"https://api.github.com/users/Ravikharatmal/gists{/gist_id}","starred_url":"https://api.github.com/users/Ravikharatmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ravikharatmal/subscriptions","organizations_url":"https://api.github.com/users/Ravikharatmal/orgs","repos_url":"https://api.github.com/users/Ravikharatmal/repos","events_url":"https://api.github.com/users/Ravikharatmal/events{/privacy}","received_events_url":"https://api.github.com/users/Ravikharatmal/received_events","type":"User","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars3.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","site_admin":false},"parents":[{"sha":"8e760da70c93f05aa8799f897ac0f44a94dfb540","url":"https://api.github.com/repos/Ravikharatmal/test/commits/8e760da70c93f05aa8799f897ac0f44a94dfb540","html_url":"https://github.com/Ravikharatmal/test/commit/8e760da70c93f05aa8799f897ac0f44a94dfb540"}]},"_links":{"self":"https://api.github.com/repos/Ravikharatmal/test/branches/develop","html":"https://github.com/Ravikharatmal/test/tree/develop"},"protected":false,"protection":{"enabled":false,"required_status_checks":{"enforcement_level":"off","contexts":[]}},"protection_url":"https://api.github.com/repos/Ravikharatmal/test/branches/develop/protection"} Branches API Response = <API RESPONSE START> { "name": "develop", "commit": { "sha": "665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "node_id": "MDY6Q29tbWl0MTk1NTA3Mzg5OjY2NWY5NjNiYjQ5YWNjMGFiOGUxZmMwMGRhZmMzZTE1ZjQ4Y2Q3YTI\u003d", "commit": { "author": { "name": "Ravi Kharatmal", "email": "ravi.kharatmal@gmail.com", "date": "2019-08-25T05:31:54Z" }, "committer": { "name": "GitHub", "email": "noreply@github.com", "date": "2019-08-25T05:31:54Z" }, "message": "Create SomeFile.txt", "tree": { "sha": "411248a03683054356cf1207d4502969e6a64eef", "url": "https://api.github.com/repos/Ravikharatmal/test/git/trees/411248a03683054356cf1207d4502969e6a64eef" }, "url": "https://api.github.com/repos/Ravikharatmal/test/git/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "comment_count": 0.0, "verification": { "verified": true, "reason": "valid", "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJdYh1KCRBK7hj4Ov3rIwAAdHIIAI7ct9R8ep1IkuIF4rb7WMTz\nxUcr+LqzFKt8XXjNo0En0T6pdZor4bT7QkilDJ5u4ic0RRPYDyI2MtC61ICTSpVc\n9HE8SpAHsaxLp+2z1/OtZXuCAEnp8TUSLUxqlUmvzpcP18oRJt/9EGXKt9FtLEyZ\nst+cfPdSC6e0CefVfRX1y/7yOb2J5nLqlwz7lphq7T8EPiA+wo50QOiMVsKba5no\ncGWjVzGwujSNeYN6wk7LYpAZyGnQwwTgMF6YkhWulRfimFIzKPIJuo7mzqpimOWK\ne67+xvisNWZTC2zUGVLBZxXsGfSI6Qa1K5c4AwxErzvIrwjuNY18QKpKq+lhAbg\u003d\n\u003dSvUr\n-----END PGP SIGNATURE-----\n", "payload": "tree 411248a03683054356cf1207d4502969e6a64eef\nparent 8e760da70c93f05aa8799f897ac0f44a94dfb540\nauthor Ravi Kharatmal \u003cravi.kharatmal@gmail.com\u003e 1566711114 -0700\ncommitter GitHub \u003cnoreply@github.com\u003e 1566711114 -0700\n\nCreate SomeFile.txt" } }, "url": "https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "html_url": "https://github.com/Ravikharatmal/test/commit/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "comments_url": "https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2/comments", "author": { "login": "Ravikharatmal", "id": 6250135.0, "node_id": "MDQ6VXNlcjYyNTAxMzU\u003d", "avatar_url": "https://avatars0.githubusercontent.com/u/6250135?v\u003d4", "gravatar_id": "", "url": "https://api.github.com/users/Ravikharatmal", "html_url": "https://github.com/Ravikharatmal", "followers_url": "https://api.github.com/users/Ravikharatmal/followers", "following_url": "https://api.github.com/users/Ravikharatmal/following{/other_user}", "gists_url": "https://api.github.com/users/Ravikharatmal/gists{/gist_id}", "starred_url": "https://api.github.com/users/Ravikharatmal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Ravikharatmal/subscriptions", "organizations_url": "https://api.github.com/users/Ravikharatmal/orgs", "repos_url": "https://api.github.com/users/Ravikharatmal/repos", "events_url": "https://api.github.com/users/Ravikharatmal/events{/privacy}", "received_events_url": "https://api.github.com/users/Ravikharatmal/received_events", "type": "User", "site_admin": false }, "committer": { "login": "web-flow", "id": 1.9864447E7, "node_id": "MDQ6VXNlcjE5ODY0NDQ3", "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v\u003d4", "gravatar_id": "", "url": "https://api.github.com/users/web-flow", "html_url": "https://github.com/web-flow", "followers_url": "https://api.github.com/users/web-flow/followers", "following_url": "https://api.github.com/users/web-flow/following{/other_user}", "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", "organizations_url": "https://api.github.com/users/web-flow/orgs", "repos_url": "https://api.github.com/users/web-flow/repos", "events_url": "https://api.github.com/users/web-flow/events{/privacy}", "received_events_url": "https://api.github.com/users/web-flow/received_events", "type": "User", "site_admin": false }, "parents": [ { "sha": "8e760da70c93f05aa8799f897ac0f44a94dfb540", "url": "https://api.github.com/repos/Ravikharatmal/test/commits/8e760da70c93f05aa8799f897ac0f44a94dfb540", "html_url": "https://github.com/Ravikharatmal/test/commit/8e760da70c93f05aa8799f897ac0f44a94dfb540" } ] }, "_links": { "self": "https://api.github.com/repos/Ravikharatmal/test/branches/develop", "html": "https://github.com/Ravikharatmal/test/tree/develop" }, "protected": false, "protection": { "enabled": false, "required_status_checks": { "enforcement_level": "off", "contexts": [] } }, "protection_url": "https://api.github.com/repos/Ravikharatmal/test/branches/develop/protection" } <API RESPONSE END> TREE API URL = https://api.github.com/repos/Ravikharatmal/test/git/trees/411248a03683054356cf1207d4502969e6a64eef content = {"sha":"411248a03683054356cf1207d4502969e6a64eef","url":"https://api.github.com/repos/Ravikharatmal/test/git/trees/411248a03683054356cf1207d4502969e6a64eef","tree":[{"path":".gitignore","mode":"100644","type":"blob","sha":"5f2dbe11df91c879164ae1150f5577ac7263c1da","size":277,"url":"https://api.github.com/repos/Ravikharatmal/test/git/blobs/5f2dbe11df91c879164ae1150f5577ac7263c1da"},{"path":"README.md","mode":"100644","type":"blob","sha":"949311fee79bfc0102fc9015d46a283e0b252d3a","size":75,"url":"https://api.github.com/repos/Ravikharatmal/test/git/blobs/949311fee79bfc0102fc9015d46a283e0b252d3a"},{"path":"fileInDevelop.txt","mode":"100644","type":"blob","sha":"7ae2e2119a7ef448dd397b6049c55f329096ab8e","size":44,"url":"https://api.github.com/repos/Ravikharatmal/test/git/blobs/7ae2e2119a7ef448dd397b6049c55f329096ab8e"},{"path":"fileInMaster.txt","mode":"100644","type":"blob","sha":"a744f3268f141a5a35a666d96fbe5dd174e784c4","size":23,"url":"https://api.github.com/repos/Ravikharatmal/test/git/blobs/a744f3268f141a5a35a666d96fbe5dd174e784c4"},{"path":"some-dir","mode":"040000","type":"tree","sha":"e7c5c0e0f9175fa416c13358d75886e13965652e","url":"https://api.github.com/repos/Ravikharatmal/test/git/trees/e7c5c0e0f9175fa416c13358d75886e13965652e"},{"path":"some-dir/SomeFile.txt","mode":"100644","type":"blob","sha":"a7c81c009a1dab936d79b14b432229f8eac8f483","size":59,"url":"https://api.github.com/repos/Ravikharatmal/test/git/blobs/a7c81c009a1dab936d79b14b432229f8eac8f483"}],"truncated":false} TREE API Response = <API RESPONSE START> { "name": "develop", "commit": { "sha": "665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "node_id": "MDY6Q29tbWl0MTk1NTA3Mzg5OjY2NWY5NjNiYjQ5YWNjMGFiOGUxZmMwMGRhZmMzZTE1ZjQ4Y2Q3YTI\u003d", "commit": { "author": { "name": "Ravi Kharatmal", "email": "ravi.kharatmal@gmail.com", "date": "2019-08-25T05:31:54Z" }, "committer": { "name": "GitHub", "email": "noreply@github.com", "date": "2019-08-25T05:31:54Z" }, "message": "Create SomeFile.txt", "tree": { "sha": "411248a03683054356cf1207d4502969e6a64eef", "url": "https://api.github.com/repos/Ravikharatmal/test/git/trees/411248a03683054356cf1207d4502969e6a64eef" }, "url": "https://api.github.com/repos/Ravikharatmal/test/git/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "comment_count": 0.0, "verification": { "verified": true, "reason": "valid", "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsBcBAABCAAQBQJdYh1KCRBK7hj4Ov3rIwAAdHIIAI7ct9R8ep1IkuIF4rb7WMTz\nxUcr+LqzFKt8XXjNo0En0T6pdZor4bT7QkilDJ5u4ic0RRPYDyI2MtC61ICTSpVc\n9HE8SpAHsaxLp+2z1/OtZXuCAEnp8TUSLUxqlUmvzpcP18oRJt/9EGXKt9FtLEyZ\nst+cfPdSC6e0CefVfRX1y/7yOb2J5nLqlwz7lphq7T8EPiA+wo50QOiMVsKba5no\ncGWjVzGwujSNeYN6wk7LYpAZyGnQwwTgMF6YkhWulRfimFIzKPIJuo7mzqpimOWK\ne67+xvisNWZTC2zUGVLBZxXsGfSI6Qa1K5c4AwxErzvIrwjuNY18QKpKq+lhAbg\u003d\n\u003dSvUr\n-----END PGP SIGNATURE-----\n", "payload": "tree 411248a03683054356cf1207d4502969e6a64eef\nparent 8e760da70c93f05aa8799f897ac0f44a94dfb540\nauthor Ravi Kharatmal \u003cravi.kharatmal@gmail.com\u003e 1566711114 -0700\ncommitter GitHub \u003cnoreply@github.com\u003e 1566711114 -0700\n\nCreate SomeFile.txt" } }, "url": "https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "html_url": "https://github.com/Ravikharatmal/test/commit/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2", "comments_url": "https://api.github.com/repos/Ravikharatmal/test/commits/665f963bb49acc0ab8e1fc00dafc3e15f48cd7a2/comments", "author": { "login": "Ravikharatmal", "id": 6250135.0, "node_id": "MDQ6VXNlcjYyNTAxMzU\u003d", "avatar_url": "https://avatars0.githubusercontent.com/u/6250135?v\u003d4", "gravatar_id": "", "url": "https://api.github.com/users/Ravikharatmal", "html_url": "https://github.com/Ravikharatmal", "followers_url": "https://api.github.com/users/Ravikharatmal/followers", "following_url": "https://api.github.com/users/Ravikharatmal/following{/other_user}", "gists_url": "https://api.github.com/users/Ravikharatmal/gists{/gist_id}", "starred_url": "https://api.github.com/users/Ravikharatmal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Ravikharatmal/subscriptions", "organizations_url": "https://api.github.com/users/Ravikharatmal/orgs", "repos_url": "https://api.github.com/users/Ravikharatmal/repos", "events_url": "https://api.github.com/users/Ravikharatmal/events{/privacy}", "received_events_url": "https://api.github.com/users/Ravikharatmal/received_events", "type": "User", "site_admin": false }, "committer": { "login": "web-flow", "id": 1.9864447E7, "node_id": "MDQ6VXNlcjE5ODY0NDQ3", "avatar_url": "https://avatars3.githubusercontent.com/u/19864447?v\u003d4", "gravatar_id": "", "url": "https://api.github.com/users/web-flow", "html_url": "https://github.com/web-flow", "followers_url": "https://api.github.com/users/web-flow/followers", "following_url": "https://api.github.com/users/web-flow/following{/other_user}", "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}", "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions", "organizations_url": "https://api.github.com/users/web-flow/orgs", "repos_url": "https://api.github.com/users/web-flow/repos", "events_url": "https://api.github.com/users/web-flow/events{/privacy}", "received_events_url": "https://api.github.com/users/web-flow/received_events", "type": "User", "site_admin": false }, "parents": [ { "sha": "8e760da70c93f05aa8799f897ac0f44a94dfb540", "url": "https://api.github.com/repos/Ravikharatmal/test/commits/8e760da70c93f05aa8799f897ac0f44a94dfb540", "html_url": "https://github.com/Ravikharatmal/test/commit/8e760da70c93f05aa8799f897ac0f44a94dfb540" } ] }, "_links": { "self": "https://api.github.com/repos/Ravikharatmal/test/branches/develop", "html": "https://github.com/Ravikharatmal/test/tree/develop" }, "protected": false, "protection": { "enabled": false, "required_status_checks": { "enforcement_level": "off", "contexts": [] } }, "protection_url": "https://api.github.com/repos/Ravikharatmal/test/branches/develop/protection" } <API RESPONSE END> Directory & files list : File = .gitignore | Size = 277.0 Bytes File = README.md | Size = 75.0 Bytes File = fileInDevelop.txt | Size = 44.0 Bytes File = fileInMaster.txt | Size = 23.0 Bytes Directory = some-dir File = some-dir/SomeFile.txt | Size = 59.0 Bytes |
Complete code is also committed & available in GitHub repository.