|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 5 | + <meta http-equiv="Content-Language" content="en-us" /> |
| 6 | + <meta http-equiv="imagetoolbar" content="false" /> |
| 7 | + <meta name="MSSmartTagsPreventParsing" content="true" /> |
| 8 | + <title>Git Tags | GitHub API</title> |
| 9 | + <link href="/css/reset.css" rel="stylesheet" type="text/css" /> |
| 10 | + <link href="/css/960.css" rel="stylesheet" type="text/css" /> |
| 11 | + <link href="/css/uv_active4d.css" rel="stylesheet" type="text/css" /> |
| 12 | + <link href="/shared/css/documentation.css" media="screen" rel="stylesheet" type="text/css"> |
| 13 | + <link href="/shared/css/pygments.css" media="screen" rel="stylesheet" type="text/css"> |
| 14 | + <script src="/shared/js/jquery.js" type="text/javascript"></script> |
| 15 | + <script src="/shared/js/documentation.js" type="text/javascript"></script> |
| 16 | +</head> |
| 17 | +<body class="api"> |
| 18 | + |
| 19 | + <div id="header-wrapper"> |
| 20 | + <div id="header"> |
| 21 | + <div> |
| 22 | + <a class="logo" href="/"><img src="/images/logo_developer.png" width="255" height="45" /></a> |
| 23 | + <ul class="nav"> |
| 24 | + <li><a href="/v3/">API v3</a></li> |
| 25 | + <li><a href="http://develop.github.com">API v2</a></li> |
| 26 | + <li><a |
| 27 | + href="http://support.github.com/discussions/api">Support</a></li> |
| 28 | + </ul> |
| 29 | + </div> |
| 30 | + </div><!-- #header --> |
| 31 | + </div><!-- #header-wrapper --> |
| 32 | + |
| 33 | + <div id="wrapper"> |
| 34 | + <div class="content"> |
| 35 | + <h1 id="tags-api">Tags API</h1> |
| 36 | + |
| 37 | +<p>This tags API only deals with tag objects - so only annotated tags, not |
| 38 | +lightweight tags.</p> |
| 39 | + |
| 40 | +<h2 id="get-a-tag">Get a Tag</h2> |
| 41 | + |
| 42 | +<pre><code>GET /repos/:user/:repo/git/tags/:sha |
| 43 | +</code></pre> |
| 44 | + |
| 45 | +<h3 id="response">Response</h3> |
| 46 | + |
| 47 | +<pre class="headers"><code>Status: 200 OK |
| 48 | +X-RateLimit-Limit: 5000 |
| 49 | +X-RateLimit-Remaining: 4999</code></pre> |
| 50 | + |
| 51 | +<pre class="highlight"><code class="language-javascript"><span class="p">{</span> |
| 52 | + <span class="s2">"tag"</span><span class="o">:</span> <span class="s2">"v0.0.1"</span><span class="p">,</span> |
| 53 | + <span class="s2">"sha"</span><span class="o">:</span> <span class="s2">"940bd336248efae0f9ee5bc7b2d5c985887b16ac"</span><span class="p">,</span> |
| 54 | + <span class="s2">"url"</span><span class="o">:</span> <span class="s2">"https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac"</span><span class="p">,</span> |
| 55 | + <span class="s2">"message"</span><span class="o">:</span> <span class="s2">"initial version\n"</span><span class="p">,</span> |
| 56 | + <span class="s2">"tagger"</span><span class="o">:</span> <span class="p">{</span> |
| 57 | + <span class="s2">"name"</span><span class="o">:</span> <span class="s2">"Scott Chacon"</span><span class="p">,</span> |
| 58 | + <span class="s2">"email"</span><span class="o">:</span> <span class="s2">"schacon@gmail.com"</span><span class="p">,</span> |
| 59 | + <span class="s2">"date"</span><span class="o">:</span> <span class="s2">"2011-06-17T14:53:35-07:00"</span> |
| 60 | + <span class="p">},</span> |
| 61 | + <span class="s2">"object"</span><span class="o">:</span> <span class="p">{</span> |
| 62 | + <span class="s2">"type"</span><span class="o">:</span> <span class="s2">"commit"</span><span class="p">,</span> |
| 63 | + <span class="s2">"sha"</span><span class="o">:</span> <span class="s2">"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"</span><span class="p">,</span> |
| 64 | + <span class="s2">"url"</span><span class="o">:</span> <span class="s2">"https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"</span> |
| 65 | + <span class="p">}</span> |
| 66 | +<span class="p">}</span> |
| 67 | +</code></pre> |
| 68 | + |
| 69 | +<h2 id="create-a-tag-object">Create a Tag Object</h2> |
| 70 | + |
| 71 | +<p>Note that creating a tag object does not create the reference that |
| 72 | +makes a tag in Git. If you want to create an annotated tag in Git, |
| 73 | +you have to do this call to create the tag object, and then create |
| 74 | +the <code>refs/tags/[tag]</code> reference. If you want to create a lightweight |
| 75 | +tag, you simply have to create the reference - this call would be |
| 76 | +unnecessary.</p> |
| 77 | + |
| 78 | +<pre><code>POST /repos/:user/:repo/git/tags |
| 79 | +</code></pre> |
| 80 | + |
| 81 | +<h3 id="parameters">Parameters</h3> |
| 82 | + |
| 83 | +<dl> |
| 84 | +<dt>tag</dt> |
| 85 | + <dd> |
| 86 | +<em>String</em> of the tag</dd> |
| 87 | + <dt>message</dt> |
| 88 | + <dd> |
| 89 | +<em>String</em> of the tag message</dd> |
| 90 | + <dt>object</dt> |
| 91 | + <dd> |
| 92 | +<em>String</em> of the SHA of the git object this is tagging</dd> |
| 93 | + <dt>type</dt> |
| 94 | + <dd> |
| 95 | +<em>String</em> of the type of the object we’re tagging. Normally this is a |
| 96 | +<code>commit</code> but it can also be a <code>tree</code> or a <code>blob</code>.</dd> |
| 97 | + <dt>tagger.name</dt> |
| 98 | + <dd> |
| 99 | +<em>String</em> of the name of the author of the tag</dd> |
| 100 | + <dt>tagger.email</dt> |
| 101 | + <dd> |
| 102 | +<em>String</em> of the email of the author of the tag</dd> |
| 103 | + <dt>tagger.date</dt> |
| 104 | + <dd> |
| 105 | +<em>Timestamp</em> of when this object was tagged</dd> |
| 106 | +</dl><h3 id="response-1">Response</h3> |
| 107 | + |
| 108 | +<pre class="headers"><code>Status: 201 Created |
| 109 | +Location: https://api.github.com/repos/:user/:repo/git/tags/:sha |
| 110 | +X-RateLimit-Limit: 5000 |
| 111 | +X-RateLimit-Remaining: 4999</code></pre> |
| 112 | + |
| 113 | +<pre class="highlight"><code class="language-javascript"><span class="p">{</span> |
| 114 | + <span class="s2">"tag"</span><span class="o">:</span> <span class="s2">"v0.0.1"</span><span class="p">,</span> |
| 115 | + <span class="s2">"sha"</span><span class="o">:</span> <span class="s2">"940bd336248efae0f9ee5bc7b2d5c985887b16ac"</span><span class="p">,</span> |
| 116 | + <span class="s2">"url"</span><span class="o">:</span> <span class="s2">"https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac"</span><span class="p">,</span> |
| 117 | + <span class="s2">"message"</span><span class="o">:</span> <span class="s2">"initial version\n"</span><span class="p">,</span> |
| 118 | + <span class="s2">"tagger"</span><span class="o">:</span> <span class="p">{</span> |
| 119 | + <span class="s2">"name"</span><span class="o">:</span> <span class="s2">"Scott Chacon"</span><span class="p">,</span> |
| 120 | + <span class="s2">"email"</span><span class="o">:</span> <span class="s2">"schacon@gmail.com"</span><span class="p">,</span> |
| 121 | + <span class="s2">"date"</span><span class="o">:</span> <span class="s2">"2011-06-17T14:53:35-07:00"</span> |
| 122 | + <span class="p">},</span> |
| 123 | + <span class="s2">"object"</span><span class="o">:</span> <span class="p">{</span> |
| 124 | + <span class="s2">"type"</span><span class="o">:</span> <span class="s2">"commit"</span><span class="p">,</span> |
| 125 | + <span class="s2">"sha"</span><span class="o">:</span> <span class="s2">"c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"</span><span class="p">,</span> |
| 126 | + <span class="s2">"url"</span><span class="o">:</span> <span class="s2">"https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"</span> |
| 127 | + <span class="p">}</span> |
| 128 | +<span class="p">}</span> |
| 129 | +</code></pre> |
| 130 | + </div> |
| 131 | + |
| 132 | + <div id="js-sidebar" class="sidebar-shell"> |
| 133 | + <div class="js-toggle-list sidebar-module expandable"> |
| 134 | + <ul> |
| 135 | + <li class="js-topic"> |
| 136 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/">Summary</a></h3> |
| 137 | + <ul class="js-guides"> |
| 138 | + <li><a href="/v3/oauth/">OAuth</a></li> |
| 139 | + <li><a href="/v3/mime/">Mime Types</a></li> |
| 140 | + <li><a href="/v3/changelog/">Changelog</a></li> |
| 141 | + <li><a href="/v3/libraries/">Libraries</a></li> |
| 142 | + </ul> |
| 143 | + </li> |
| 144 | + <li class="js-topic"> |
| 145 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/gists/">Gists</a></h3> |
| 146 | + <ul class="js-guides"> |
| 147 | + <li><a href="/v3/gists/comments/">Comments</a></li> |
| 148 | + </ul> |
| 149 | + </li> |
| 150 | + <li class="js-topic"> |
| 151 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/git/">Git Data</a></h3> |
| 152 | + <ul class="js-guides"> |
| 153 | + <li><a href="/v3/git/blobs/">Blobs</a></li> |
| 154 | + <li><a href="/v3/git/commits/">Commits</a></li> |
| 155 | + <li><a href="/v3/git/refs/">References</a></li> |
| 156 | + <li><a href="/v3/git/tags/">Tags</a></li> |
| 157 | + <li><a href="/v3/git/trees/">Trees</a></li> |
| 158 | + </ul> |
| 159 | + </li> |
| 160 | + <li class="js-topic"> |
| 161 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/issues/">Issues</a></h3> |
| 162 | + <ul class="js-guides"> |
| 163 | + <li><a href="/v3/issues/comments/">Comments</a></li> |
| 164 | + <li><a href="/v3/issues/events/">Events</a></li> |
| 165 | + <li><a href="/v3/issues/labels/">Labels</a></li> |
| 166 | + <li><a href="/v3/issues/milestones/">Milestones</a></li> |
| 167 | + </ul> |
| 168 | + </li> |
| 169 | + <li class="js-topic"> |
| 170 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/orgs/">Orgs</a></h3> |
| 171 | + <ul class="js-guides"> |
| 172 | + <li><a href="/v3/orgs/members/">Members</a></li> |
| 173 | + <li><a href="/v3/orgs/teams/">Teams</a></li> |
| 174 | + </ul> |
| 175 | + </li> |
| 176 | + <li class="js-topic"> |
| 177 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/pulls/">Pull Requests</a></h3> |
| 178 | + <ul class="js-guides"> |
| 179 | + <li><a href="/v3/pulls/comments/">Review Comments</a></li> |
| 180 | + </ul> |
| 181 | + </li> |
| 182 | + <li class="js-topic"> |
| 183 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/repos/">Repos</a></h3> |
| 184 | + <ul class="js-guides"> |
| 185 | + <li><a href="/v3/repos/collaborators/">Collaborators</a></li> |
| 186 | + <li><a href="/v3/repos/commits/">Commits</a></li> |
| 187 | + <li><a href="/v3/repos/downloads/">Downloads</a></li> |
| 188 | + <li><a href="/v3/repos/forks/">Forks</a></li> |
| 189 | + <li><a href="/v3/repos/keys/">Keys</a></li> |
| 190 | + <li><a href="/v3/repos/watching/">Watching</a></li> |
| 191 | + <li><a href="/v3/repos/hooks/">Hooks</a></li> |
| 192 | + </ul> |
| 193 | + </li> |
| 194 | + <li class="js-topic"> |
| 195 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/users/">Users</a></h3> |
| 196 | + <ul class="js-guides"> |
| 197 | + <li><a href="/v3/users/emails/">Emails</a></li> |
| 198 | + <li><a href="/v3/users/followers/">Followers</a></li> |
| 199 | + <li><a href="/v3/users/keys/">Keys</a></li> |
| 200 | + </ul> |
| 201 | + </li> |
| 202 | + <li class="js-topic"> |
| 203 | + <h3><a href="#" class="js-expand-btn collapsed"> </a><a href="/v3/events/">Events</a></h3> |
| 204 | + <ul class="js-guides"> |
| 205 | + <li><a href="/v3/events/types/">Types</a></li> |
| 206 | + </ul> |
| 207 | + </li> |
| 208 | + </ul> |
| 209 | + </div> <!-- /sidebar-module --> |
| 210 | + <div class="sidebar-module"> |
| 211 | + <p>This website is a <a href="https://github.com/github/developer.github.com" target="_blank">public GitHub repo</a>. Please help us by forking the project and adding to it.</p> |
| 212 | + </div> |
| 213 | + </div><!-- /sidebar-shell --> |
| 214 | + |
| 215 | + </div><!-- #wrapper --> |
| 216 | + |
| 217 | + <div id="footer" > |
| 218 | + <div class="upper_footer"> |
| 219 | + <div class="footer_inner clearfix"> |
| 220 | + |
| 221 | + <!--[if IE]><h4 id="blacktocat_ie">GitHub Links</h4><![endif]--> |
| 222 | + <![if !IE]><h4 id="blacktocat">GitHub Links</h4><![endif]> |
| 223 | + |
| 224 | + <ul class="footer_nav"> |
| 225 | + <h4>GitHub</h4> |
| 226 | + <li><a href="https://github.com/about">About</a></li> |
| 227 | + <li><a href="https://github.com/blog">Blog</a></li> |
| 228 | + <li><a href="https://github.com/features">Features</a></li> |
| 229 | + <li><a href="https://github.com/contact">Contact & Support</a></li> |
| 230 | + <li><a href="https://github.com/training">Training</a></li> |
| 231 | + <li><a href="http://status.github.com/">Site Status</a></li> |
| 232 | + </ul> |
| 233 | + |
| 234 | + <ul class="footer_nav"> |
| 235 | + <h4>Tools</h4> |
| 236 | + <li><a href="http://mac.github.com/">GitHub for Mac</a></li> |
| 237 | + <li><a href="http://mobile.github.com/">Issues for iPhone</a></li> |
| 238 | + <li><a href="https://gist.github.com">Gist: Code Snippets</a></li> |
| 239 | + <li><a href="http://enterprise.github.com/">GitHub Enterprise</a></li> |
| 240 | + <li><a href="http://jobs.github.com/">Job Board</a></li> |
| 241 | + </ul> |
| 242 | + |
| 243 | + <ul class="footer_nav"> |
| 244 | + <h4>Extras</h4> |
| 245 | + <li><a href="http://shop.github.com/">GitHub Shop</a></li> |
| 246 | + <li><a href="http://octodex.github.com/">The Octodex</a></li> |
| 247 | + </ul> |
| 248 | + |
| 249 | + <ul class="footer_nav"> |
| 250 | + <h4>Documentation</h4> |
| 251 | + <li><a href="http://help.github.com/">GitHub Help</a></li> |
| 252 | + <li><a href="http://developer.github.com/">Developer API</a></li> |
| 253 | + <li><a href="http://github.github.com/github-flavored-markdown/">GitHub Flavored Markdown</a></li> |
| 254 | + <li><a href="http://pages.github.com/">GitHub Pages</a></li> |
| 255 | + </ul> |
| 256 | + |
| 257 | + </div><!-- /.site --> |
| 258 | + </div><!-- /.upper_footer --> |
| 259 | + |
| 260 | + <div class="lower_footer"> |
| 261 | + <div class="footer_inner clearfix"> |
| 262 | + <div id="legal"> |
| 263 | + <!--[if IE]><a class="home_ie" href="http://github.com">Home</a><![endif]--> |
| 264 | + <![if !IE]><a class="home" href="http://github.com">Home</a><![endif]> |
| 265 | + |
| 266 | + <ul id="legal_links"> |
| 267 | + <li><a href="http://help.github.com/terms-of-service/">Terms of Service</a></li> |
| 268 | + <li><a href="http://help.github.com/privacy-policy/">Privacy</a></li> |
| 269 | + <li><a href="http://help.github.com/security/">Security</a></li> |
| 270 | + </ul> |
| 271 | + |
| 272 | + <p>© <span id="year">year</span> GitHub Inc. All rights reserved.</p> |
| 273 | + </div><!-- /#legal or /#legal_ie--> |
| 274 | + |
| 275 | + <div class="sponsor"> |
| 276 | + <a href="http://www.rackspace.com" class="logo"> |
| 277 | + <img src="/shared/images/rackspace_logo.png" alt="Dedicated Server" width="38" height="36"> |
| 278 | + </a> |
| 279 | + Powered by the <a href="http://www.rackspace.com ">Dedicated |
| 280 | + Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud |
| 281 | + Computing</a> of Rackspace Hosting<span>®</span> |
| 282 | + </div> |
| 283 | + </div><!-- /.site --> |
| 284 | + </div><!-- /.lower_footer --> |
| 285 | + </div><!-- /#footer --> |
| 286 | + <script type="text/javascript"> |
| 287 | + var _gauges = _gauges || []; |
| 288 | + (function() { |
| 289 | + var t = document.createElement('script'); |
| 290 | + t.type = 'text/javascript'; |
| 291 | + t.async = true; |
| 292 | + t.id = 'gauges-tracker'; |
| 293 | + t.setAttribute('data-site-id', '4f2038e0cb25bc1b55000003'); |
| 294 | + t.src = '//secure.gaug.es/track.js'; |
| 295 | + var s = document.getElementsByTagName('script')[0]; |
| 296 | + s.parentNode.insertBefore(t, s); |
| 297 | + })(); |
| 298 | + </script> |
| 299 | +</body> |
| 300 | +</html> |
0 commit comments