|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | + |
| 4 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | +<head> |
| 6 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| 7 | + <title>Develop.GitHub - </title> |
| 8 | + <script type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script> |
| 9 | + <script type="text/javascript" src="../js/thickbox-compressed.js"></script> |
| 10 | + <script type="text/javascript" src="../js/jquery.corner.js"></script> |
| 11 | + |
| 12 | + <link rel="stylesheet" href="../css/screen.css" type="text/css" media="screen, projection"> |
| 13 | + <link rel="stylesheet" href="../css/print.css" type="text/css" media="print"> |
| 14 | + <!--[if IE]> |
| 15 | + <link rel="stylesheet" href="../css/ie.css" type="text/css" media="screen, projection"> |
| 16 | + <![endif]--> |
| 17 | + |
| 18 | + <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8"/> |
| 19 | + <link rel="stylesheet" href="../css/thickbox.css" type="text/css" media="screen"/> |
| 20 | +</head> |
| 21 | + |
| 22 | +<body> |
| 23 | + <div class="container"> |
| 24 | + |
| 25 | + <div class="span-21" id="header"> |
| 26 | + <div class="span-10"> |
| 27 | + <a href="/"><img src="../images/develop-github.png" alt="github learn logo" /></a> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div class="span-11 last"> |
| 31 | + <div id="links"> |
| 32 | + <a href="http://github.com">home</a> |
| 33 | + <a href="http://github.com/login">login</a> |
| 34 | + <a href="http://github.com/signup">signup!</a> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="span-21 last content"> |
| 40 | + <h2 id='git_object_api'>Git Object API</h2> |
| 41 | + |
| 42 | +<h3 id='trees'>Trees</h3> |
| 43 | + |
| 44 | +<p>Can get the contents of a tree by tree sha</p> |
| 45 | + |
| 46 | +<pre><code>tree/show/:user/:repo/:tree_sha</code></pre> |
| 47 | + |
| 48 | +<p>To get a listing of the root tree for the facebox project from our commit listing, we can call this:</p> |
| 49 | + |
| 50 | +<pre><code>$ curl http://github.com/api/v2/yaml/tree/show/defunkt/facebox/f7a5de2e224ec94182a3c2c081f4e7f4df70da4 |
| 51 | +--- |
| 52 | +tree: |
| 53 | +- name: .gitignore |
| 54 | + sha: e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf |
| 55 | + mode: "100644" |
| 56 | + type: blob |
| 57 | +- name: README.txt |
| 58 | + sha: d4fc2d5e810d9b4bc1ce67702603080e3086a4ed |
| 59 | + mode: "100644" |
| 60 | + type: blob |
| 61 | +- name: b.png |
| 62 | + sha: f184e6269b343014f58694093b55558dd5dde193 |
| 63 | + mode: "100644" |
| 64 | + type: blob |
| 65 | +- name: bl.png |
| 66 | + sha: f6271859d51654b6fb2719df5fe192c8398ecefc |
| 67 | + mode: "100644" |
| 68 | + type: blob</code></pre> |
| 69 | + |
| 70 | +<h3 id='blobs'>Blobs</h3> |
| 71 | + |
| 72 | +<p>Can get the data about a blob by tree sha and path</p> |
| 73 | + |
| 74 | +<pre><code>blob/show/:user/:repo/:tree_sha/:path</code></pre> |
| 75 | + |
| 76 | +<p>For example, to get the README.txt metadata from a specific tree in Facebox:</p> |
| 77 | + |
| 78 | +<pre><code>$ curl http://localhost:3000/api/v2/yaml/blob/show/defunkt/facebox/f7a5de2e224ec94182a3c2c081f4e7f4d/README.txt |
| 79 | +--- |
| 80 | +blob: |
| 81 | + name: README.txt |
| 82 | + size: 178 |
| 83 | + sha: d4fc2d5e810d9b4bc1ce67702603080e3086a4ed |
| 84 | + mode: "100644" |
| 85 | + mime_type: text/plain |
| 86 | + data: | |
| 87 | + Please visit http://famspam.com/facebox/ or open index.html in your favorite browser. |
| 88 | + |
| 89 | + Need help? Join our Google Groups mailing list: |
| 90 | + http://groups.google.com/group/facebox/</code></pre> |
| 91 | + |
| 92 | +<h3 id='raw_git_data'>Raw Git Data</h3> |
| 93 | + |
| 94 | +<p>You can get the contents of a blob with the blobs s via:</p> |
| 95 | + |
| 96 | +<pre><code>blob/show/:user/:repo/:sha</code></pre> |
| 97 | + |
| 98 | +<p>It is important to note that it doesn’t matter which type you specify (yaml, xml, json), the output will simply be the raw output.</p> |
| 99 | + |
| 100 | +<p>Here is an example of getting a README file from Facebox:</p> |
| 101 | + |
| 102 | +<pre><code>$ curl http://github.com/api/v2/yaml/blob/show/defunkt/facebox/d4fc2d5e810d9b4bc1ce67702603080e3086a4ed |
| 103 | +Please visit http://famspam.com/facebox/ or open index.html in your favorite browser. |
| 104 | + |
| 105 | +Need help? Join our Google Groups mailing list: |
| 106 | + http://groups.google.com/group/facebox/</code></pre> |
| 107 | + |
| 108 | +<p>You can actually get raw trees and commits this way, too. If you give it a tree SHA instead, you’ll get this:</p> |
| 109 | + |
| 110 | +<pre><code>$ curl http://github.com/api/v2/yaml/blob/show/defunkt/facebox/f7a5de2e224ec94182a3c2c081f4e7f4d |
| 111 | +100644 blob e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf .gitignore |
| 112 | +100644 blob d4fc2d5e810d9b4bc1ce67702603080e3086a4ed README.txt |
| 113 | +100644 blob f184e6269b343014f58694093b55558dd5dde193 b.png |
| 114 | +100644 blob f6271859d51654b6fb2719df5fe192c8398ecefc bl.png |
| 115 | +100644 blob 31f204fc451cd9dd5cfdadfad2d86ed0e1104882 br.png |
| 116 | +100755 blob 08f6f1fce2f6a02dcb15b6c66244470794587bb0 build_tar.sh |
| 117 | +100755 blob 87b4f8bd699386e3a6fcc2e50d7c61bfc4aabb8d closelabel.gif |
| 118 | +100644 blob 97ebe3cab3eab76253f9cc5fc894b339456da86e facebox.css |
| 119 | +100644 blob 2ea88c96ebb00d38d5ae6abad57c917f156802cc facebox.js |
| 120 | +100644 blob dc61a86c3f342b930f0a0447cae33fee812e27d3 faceplant.css |
| 121 | +100644 blob 355442b51047a30479c21096e06e0906e4e9a4ee index.html |
| 122 | +100644 blob ebe02bdd357c337e0e817fcbce2a034a54a13287 jquery.js |
| 123 | +100755 blob f864d5fd38b7466c76b5a36dc0e3e9455c0126e2 loading.gif |
| 124 | +100644 blob e41cfe5c654e8e05ad46f15af1c462a1360e9764 logo.png |
| 125 | +040000 tree 82e3a754b6a0fcb238b03c0e47d05219fbf9cf89 releases |
| 126 | +100644 blob 98d3e92373d1bc541e7f516e5e73b645a991ddc2 remote.html |
| 127 | +040000 tree bbf747873075ac28667d246491ffdefbd314fe4f screenshots |
| 128 | +100644 blob e58b35b362ce5347bb5064e91a3bf8e4fed4f6ef shadow.gif |
| 129 | +100644 blob 63459bb418f5f6d896a8eb925c01f45024933ed6 stairs.jpg |
| 130 | +100644 blob 38756c5ecc3ce53b8da9555a497bd9cc20b1b1c9 test.html |
| 131 | +100644 blob d99c8f6c6eaa12d7b49a20f41f08a5006f3ea8b7 tl.png |
| 132 | +100644 blob e99b6ec8310e859fd27519694f04e1babf2ab2c4 tr.png</code></pre> |
| 133 | + |
| 134 | +<p>Here is an example of a commit:</p> |
| 135 | + |
| 136 | +<pre><code>$ curl http://github.com/api/v2/yaml/blob/show/defunkt/facebox/4bf7a39e8c4ec54f8b4cd594a3616d69004aba69 |
| 137 | +tree f7a5de2e224ec94182a3c2c081f4e7f35f70da4d |
| 138 | +parent cd13d9a61288dceb0a7aa73b55ed2fd019f4f1f7 |
| 139 | +parent 3211367cab73233af66dac2710c94682f3f3b9b2 |
| 140 | +author Chris Wanstrath < [email protected]> 1213837237 -0700 |
| 141 | +committer Chris Wanstrath < [email protected]> 1213837237 -0700 |
| 142 | + |
| 143 | +Merge branch 'master' of git://github.com/webweaver/facebox into webweaver/master</code></pre><br/><br/><hr/><div class="span-21 last"> </div><hr/> |
| 144 | + </div> |
| 145 | + |
| 146 | + <div id="footer" class="span-21"> |
| 147 | + <div class="info span-12"> |
| 148 | + <div class="links"> |
| 149 | + <a href="http://github.com/blog/148-github-shirts-now-available">T-Shirts</a> | |
| 150 | + <a href="http://github.com/blog">Blog</a> | |
| 151 | + <a href="http://support.github.com/">Support</a> | |
| 152 | + <a href="http://github.com/training">Git Training</a> | |
| 153 | + <a href="http://github.com/contact">Contact</a> | |
| 154 | + <a href="http://groups.google.com/group/github/">Google Group</a> | |
| 155 | + <a href="http://github.wordpress.com">Status</a> |
| 156 | + </div> |
| 157 | + <div class="company"> |
| 158 | + GitHub is <a href="http://logicalawesome.com/">Logical Awesome</a> ©2009 | <a href="http://github.com/site/terms">Terms of Service</a> | <a href="http://github.com/site/privacy">Privacy Policy</a> |
| 159 | + </div> |
| 160 | + </div> |
| 161 | + <div class="fork span-7"> |
| 162 | + This website is <a href="http://github.com/develop/develop.github.com">open source</a>. |
| 163 | + Please help us by forking the project and adding to it. |
| 164 | + </div> |
| 165 | + </div> |
| 166 | + |
| 167 | + </div> |
| 168 | + |
| 169 | + <script type="text/javascript"> |
| 170 | + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| 171 | + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| 172 | + </script> |
| 173 | + <script type="text/javascript"> |
| 174 | + var pageTracker = _gat._getTracker("UA-3769691-2"); |
| 175 | + pageTracker._initData(); |
| 176 | + pageTracker._trackPageview(); |
| 177 | + </script> |
| 178 | + |
| 179 | +</body> |
| 180 | +</html> |
0 commit comments