CINXE.COM
Git - git-tag Documentation
<!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript"> const currentTheme = localStorage.getItem("theme") if (currentTheme) { const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches if ((prefersDarkScheme && currentTheme === "light") || (!prefersDarkScheme && currentTheme === "dark")) { document.documentElement.dataset.theme = currentTheme } } </script> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - git-tag Documentation</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> </head> <body id="documentation"> <div class="inner"> <header> <a id="logo" href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" class="no-filter" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <div id="search-container"> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </div> <img src="/images/dark-mode.svg" id="dark-mode-button" /> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs" class="active">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> </nav> </aside> <div id="content"> <div id='reference-version'> <a class="dropdown-trigger" id="reference-languages-trigger" data-panel-id="l10n-versions-dropdown" href="#"> English ▾</a> <div class='dropdown-panel right' id='l10n-versions-dropdown'> <header>Localized versions of <strong>git-tag</strong> manual</header> <ol class='reference-previous-versions'> <li> <a href="/docs/git-tag"><span class="version">English</span> </a> </li> <li> <a href="/docs/git-tag/fr"><span class="version">Français</span> </a> </li> <li> <a href="/docs/git-tag/pt_BR"><span class="version">Português (Brasil)</span> </a> </li> <li> <a href="/docs/git-tag/zh_HANS-CN"><span class="version">简体中文</span> </a> </li> </ol> <footer> Want to read in your language or fix typos?<br/> <a href="https://github.com/jnavila/git-manpages-l10n">You can help translate this page</a>. </footer> </div> <a class="dropdown-trigger" id="reference-topics-trigger" data-panel-id="topics-dropdown" href="#">Topics ▾</a> <div class='dropdown-panel right' id='topics-dropdown'> <div class='three-column'> <div class='column-left'> <h3 class='setup'>Setup and Config</h3> <ul class='unstyled'> <li> <a href="/docs/git"> git </a> </li> <li> <a href="/docs/git-config"> config </a> </li> <li> <a href="/docs/git-help"> help </a> </li> <li> <a href="/docs/git-bugreport"> bugreport </a> </li> <li> <a href="/doc/credential-helpers"> Credential helpers </a> </li> </ul> <h3 class='projects'>Getting and Creating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-init"> init </a> </li> <li> <a href="/docs/git-clone"> clone </a> </li> </ul> <h3 class='snapshotting'>Basic Snapshotting</h3> <ul class='unstyled'> <li> <a href="/docs/git-add"> add </a> </li> <li> <a href="/docs/git-status"> status </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-commit"> commit </a> </li> <li> <a href="/docs/git-notes"> notes </a> </li> <li> <a href="/docs/git-restore"> restore </a> </li> <li> <a href="/docs/git-reset"> reset </a> </li> <li> <a href="/docs/git-rm"> rm </a> </li> <li> <a href="/docs/git-mv"> mv </a> </li> </ul> <h3 class='branching'>Branching and Merging</h3> <ul class='unstyled'> <li> <a href="/docs/git-branch"> branch </a> </li> <li> <a href="/docs/git-checkout"> checkout </a> </li> <li> <a href="/docs/git-switch"> switch </a> </li> <li> <a href="/docs/git-merge"> merge </a> </li> <li> <a href="/docs/git-mergetool"> mergetool </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-stash"> stash </a> </li> <li> <a href="/docs/git-tag"> tag </a> </li> <li> <a href="/docs/git-worktree"> worktree </a> </li> </ul> <h3 class='sharing'>Sharing and Updating Projects</h3> <ul class='unstyled'> <li> <a href="/docs/git-fetch"> fetch </a> </li> <li> <a href="/docs/git-pull"> pull </a> </li> <li> <a href="/docs/git-push"> push </a> </li> <li> <a href="/docs/git-remote"> remote </a> </li> <li> <a href="/docs/git-submodule"> submodule </a> </li> </ul> </div> <div class='column-middle'> <h3 class='inspection'>Inspection and Comparison</h3> <ul class='unstyled'> <li> <a href="/docs/git-show"> show </a> </li> <li> <a href="/docs/git-log"> log </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-difftool"> difftool </a> </li> <li> <a href="/docs/git-range-diff"> range-diff </a> </li> <li> <a href="/docs/git-shortlog"> shortlog </a> </li> <li> <a href="/docs/git-describe"> describe </a> </li> </ul> <h3 class='patching'>Patching</h3> <ul class='unstyled'> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-cherry-pick"> cherry-pick </a> </li> <li> <a href="/docs/git-diff"> diff </a> </li> <li> <a href="/docs/git-rebase"> rebase </a> </li> <li> <a href="/docs/git-revert"> revert </a> </li> </ul> <h3 class='debugging'>Debugging</h3> <ul class='unstyled'> <li> <a href="/docs/git-bisect"> bisect </a> </li> <li> <a href="/docs/git-blame"> blame </a> </li> <li> <a href="/docs/git-grep"> grep </a> </li> </ul> <h3 class='email'>Email</h3> <ul class='unstyled'> <li> <a href="/docs/git-am"> am </a> </li> <li> <a href="/docs/git-apply"> apply </a> </li> <li> <a href="/docs/git-format-patch"> format-patch </a> </li> <li> <a href="/docs/git-send-email"> send-email </a> </li> <li> <a href="/docs/git-request-pull"> request-pull </a> </li> </ul> <h3 class='external'>External Systems</h3> <ul class='unstyled'> <li> <a href="/docs/git-svn"> svn </a> </li> <li> <a href="/docs/git-fast-import"> fast-import </a> </li> </ul> <h3 class='server-admin'>Server Admin</h3> <ul class='unstyled'> <li> <a href="/docs/git-daemon"> daemon </a> </li> <li> <a href="/docs/git-update-server-info"> update-server-info </a> </li> </ul> </div> <div class='column-right'> <h3 class='guides'>Guides</h3> <ul class='unstyled'> <li> <a href="/docs/gitattributes"> gitattributes </a> </li> <li> <a href="/docs/gitcli"> Command-line interface conventions </a> </li> <li> <a href="/docs/giteveryday"> Everyday Git </a> </li> <li> <a href="/docs/gitfaq"> Frequently Asked Questions (FAQ) </a> </li> <li> <a href="/docs/gitglossary"> Glossary </a> </li> <li> <a href="/docs/githooks"> Hooks </a> </li> <li> <a href="/docs/gitignore"> gitignore </a> </li> <li> <a href="/docs/gitmodules"> gitmodules </a> </li> <li> <a href="/docs/gitrevisions"> Revisions </a> </li> <li> <a href="/docs/gitsubmodules"> Submodules </a> </li> <li> <a href="/docs/gittutorial"> Tutorial </a> </li> <li> <a href="/docs/gitworkflows"> Workflows </a> </li> <li> <a href="/docs/git#_guides"> All guides... </a> </li> </ul> <h3 class='admin'>Administration</h3> <ul class='unstyled'> <li> <a href="/docs/git-clean"> clean </a> </li> <li> <a href="/docs/git-gc"> gc </a> </li> <li> <a href="/docs/git-fsck"> fsck </a> </li> <li> <a href="/docs/git-reflog"> reflog </a> </li> <li> <a href="/docs/git-filter-branch"> filter-branch </a> </li> <li> <a href="/docs/git-instaweb"> instaweb </a> </li> <li> <a href="/docs/git-archive"> archive </a> </li> <li> <a href="/docs/git-bundle"> bundle </a> </li> </ul> <h3 class='plumbing'>Plumbing Commands</h3> <ul class='unstyled'> <li> <a href="/docs/git-cat-file"> cat-file </a> </li> <li> <a href="/docs/git-check-ignore"> check-ignore </a> </li> <li> <a href="/docs/git-checkout-index"> checkout-index </a> </li> <li> <a href="/docs/git-commit-tree"> commit-tree </a> </li> <li> <a href="/docs/git-count-objects"> count-objects </a> </li> <li> <a href="/docs/git-diff-index"> diff-index </a> </li> <li> <a href="/docs/git-for-each-ref"> for-each-ref </a> </li> <li> <a href="/docs/git-hash-object"> hash-object </a> </li> <li> <a href="/docs/git-ls-files"> ls-files </a> </li> <li> <a href="/docs/git-ls-tree"> ls-tree </a> </li> <li> <a href="/docs/git-merge-base"> merge-base </a> </li> <li> <a href="/docs/git-read-tree"> read-tree </a> </li> <li> <a href="/docs/git-rev-list"> rev-list </a> </li> <li> <a href="/docs/git-rev-parse"> rev-parse </a> </li> <li> <a href="/docs/git-show-ref"> show-ref </a> </li> <li> <a href="/docs/git-symbolic-ref"> symbolic-ref </a> </li> <li> <a href="/docs/git-update-index"> update-index </a> </li> <li> <a href="/docs/git-update-ref"> update-ref </a> </li> <li> <a href="/docs/git-verify-pack"> verify-pack </a> </li> <li> <a href="/docs/git-write-tree"> write-tree </a> </li> </ul> </div> </div> </div> <a class="dropdown-trigger" id="reference-versions-trigger" data-panel-id="previous-versions-dropdown" href="#"> Latest version ▾ </a> <span class="light d-flex">git-tag last updated in 2.46.0</span> <div class='dropdown-panel left' id='previous-versions-dropdown'> <header>Changes in the <strong>git-tag</strong> manual</header> <ol class='reference-previous-versions'> <li class="no-change"><span>2.46.1 → 2.49.0 no changes</span></li> <li> <a href="/docs/git-tag/2.46.0"><span class="version">2.46.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2024-07-29</em> </a> </li> <li class="no-change"><span>2.45.1 → 2.45.3 no changes</span></li> <li> <a href="/docs/git-tag/2.45.0"><span class="version">2.45.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2024-04-29</em> </a> </li> <li class="no-change"><span>2.44.1 → 2.44.3 no changes</span></li> <li> <a href="/docs/git-tag/2.44.0"><span class="version">2.44.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2024-02-23</em> </a> </li> <li class="no-change"><span>2.42.1 → 2.43.6 no changes</span></li> <li> <a href="/docs/git-tag/2.42.0"><span class="version">2.42.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2023-08-21</em> </a> </li> <li class="no-change"><span>2.41.1 → 2.41.3 no changes</span></li> <li> <a href="/docs/git-tag/2.41.0"><span class="version">2.41.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2023-06-01</em> </a> </li> <li class="no-change"><span>2.39.1 → 2.40.4 no changes</span></li> <li> <a href="/docs/git-tag/2.39.0"><span class="version">2.39.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2022-12-12</em> </a> </li> <li class="no-change"><span>2.35.1 → 2.38.5 no changes</span></li> <li> <a href="/docs/git-tag/2.35.0"><span class="version">2.35.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2022-01-24</em> </a> </li> <li class="no-change"><span>2.31.1 → 2.34.8 no changes</span></li> <li> <a href="/docs/git-tag/2.31.0"><span class="version">2.31.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2021-03-15</em> </a> </li> <li class="no-change"><span>2.29.1 → 2.30.9 no changes</span></li> <li> <a href="/docs/git-tag/2.29.0"><span class="version">2.29.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-10-19</em> </a> </li> <li class="no-change"><span>2.27.1 → 2.28.1 no changes</span></li> <li> <a href="/docs/git-tag/2.27.0"><span class="version">2.27.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-06-01</em> </a> </li> <li class="no-change"><span>2.25.1 → 2.26.3 no changes</span></li> <li> <a href="/docs/git-tag/2.25.0"><span class="version">2.25.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2020-01-13</em> </a> </li> <li class="no-change"><span>2.23.1 → 2.24.4 no changes</span></li> <li> <a href="/docs/git-tag/2.23.0"><span class="version">2.23.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-08-16</em> </a> </li> <li class="no-change"><span>2.21.1 → 2.22.5 no changes</span></li> <li> <a href="/docs/git-tag/2.21.0"><span class="version">2.21.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-02-24</em> </a> </li> <li class="no-change"><span>2.19.3 → 2.20.5 no changes</span></li> <li> <a href="/docs/git-tag/2.19.2"><span class="version">2.19.2</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-11-21</em> </a> </li> <li class="no-change"><span>2.19.1 no changes</span></li> <li> <a href="/docs/git-tag/2.19.0"><span class="version">2.19.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-09-10</em> </a> </li> <li class="no-change"><span>2.18.1 → 2.18.5 no changes</span></li> <li> <a href="/docs/git-tag/2.18.0"><span class="version">2.18.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-06-21</em> </a> </li> <li class="no-change"><span>2.17.1 → 2.17.6 no changes</span></li> <li> <a href="/docs/git-tag/2.17.0"><span class="version">2.17.0</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-04-02</em> </a> </li> <li class="no-change"><span>2.15.4 → 2.16.6 no changes</span></li> <li> <a href="/docs/git-tag/2.14.6"><span class="version">2.14.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2019-12-06</em> </a> </li> <li> <a href="/docs/git-tag/2.13.7"><span class="version">2.13.7</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2018-05-22</em> </a> </li> <li> <a href="/docs/git-tag/2.12.5"><span class="version">2.12.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-09-22</em> </a> </li> <li> <a href="/docs/git-tag/2.11.4"><span class="version">2.11.4</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-09-22</em> </a> </li> <li> <a href="/docs/git-tag/2.10.5"><span class="version">2.10.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-09-22</em> </a> </li> <li> <a href="/docs/git-tag/2.9.5"><span class="version">2.9.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-07-30</em> </a> </li> <li class="no-change"><span>2.8.6 no changes</span></li> <li> <a href="/docs/git-tag/2.7.6"><span class="version">2.7.6</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-07-30</em> </a> </li> <li> <a href="/docs/git-tag/2.6.7"><span class="version">2.6.7</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-05-05</em> </a> </li> <li class="no-change"><span>2.5.6 no changes</span></li> <li> <a href="/docs/git-tag/2.4.12"><span class="version">2.4.12</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2017-05-05</em> </a> </li> <li class="no-change"><span>2.2.3 → 2.3.10 no changes</span></li> <li> <a href="/docs/git-tag/2.1.4"><span class="version">2.1.4</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2014-12-17</em> </a> </li> <li> <a href="/docs/git-tag/2.0.5"><span class="version">2.0.5</span> <span class="diff"> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/green-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/red-dot.png" /> <img src="/images/icons/grey-dot.png" /> <img src="/images/icons/grey-dot.png" /> </span> <em class="date">2014-12-17</em> </a> </li> <li> </li> </ol> <footer> <p>Check your version of git by running</p> <code class="command">git --version</code> </footer> </div> </div> <div id="main" data-pagefind-filter="category:reference" data-pagefind-meta="category:Reference" data-pagefind-weight="0.05" data-pagefind-body> <div class="sect1"> <h2 id="_name"><a class="anchor" href="#_name"></a>NAME</h2> <div class="sectionbody"> <div class="paragraph"> <p>git-tag - Create, list, delete or verify a tag object signed with GPG</p> </div> </div> </div> <div class="sect1"> <h2 id="_synopsis"><a class="anchor" href="#_synopsis"></a>SYNOPSIS</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content"><em>git tag</em> [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e] [(--trailer <token>[(=|:)<value>])…​] <tagname> [<commit> | <object>] <em>git tag</em> -d <tagname>…​ <em>git tag</em> [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>] [--points-at <object>] [--column[=<options>] | --no-column] [--create-reflog] [--sort=<key>] [--format=<format>] [--merged <commit>] [--no-merged <commit>] [<pattern>…​] <em>git tag</em> -v [--format=<format>] <tagname>…​</pre> </div> </div> </div> <div class="sect1"> <h2 id="_description"><a class="anchor" href="#_description"></a>DESCRIPTION</h2> <div class="sectionbody"> <div class="paragraph"> <p>Add a tag reference in <code>refs/tags/</code>, unless <code>-d/-l/-v</code> is given to delete, list or verify tags.</p> </div> <div class="paragraph"> <p>Unless <code>-f</code> is given, the named tag must not yet exist.</p> </div> <div class="paragraph"> <p>If one of <code>-a</code>, <code>-s</code>, or <code>-u <key-id></code> is passed, the command creates a <em>tag</em> object, and requires a tag message. Unless <code>-m <msg></code> or <code>-F <file></code> is given, an editor is started for the user to type in the tag message.</p> </div> <div class="paragraph"> <p>If <code>-m <msg></code> or <code>-F <file></code> or <code>--trailer <token>[=<value>]</code> is given and <code>-a</code>, <code>-s</code>, and <code>-u <key-id></code> are absent, <code>-a</code> is implied.</p> </div> <div class="paragraph"> <p>Otherwise, a tag reference that points directly at the given object (i.e., a lightweight tag) is created.</p> </div> <div class="paragraph"> <p>A GnuPG signed tag object will be created when <code>-s</code> or <code>-u <key-id></code> is used. When <code>-u <key-id></code> is not used, the committer identity for the current user is used to find the GnuPG key for signing. The configuration variable <code>gpg.program</code> is used to specify custom GnuPG binary.</p> </div> <div class="paragraph"> <p>Tag objects (created with <code>-a</code>, <code>-s</code>, or <code>-u</code>) are called "annotated" tags; they contain a creation date, the tagger name and e-mail, a tagging message, and an optional GnuPG signature. Whereas a "lightweight" tag is simply a name for an object (usually a commit object).</p> </div> <div class="paragraph"> <p>Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels. For this reason, some git commands for naming objects (like <code>git describe</code>) will ignore lightweight tags by default.</p> </div> </div> </div> <div class="sect1"> <h2 id="_options"><a class="anchor" href="#_options"></a>OPTIONS</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-tag.txt--a"> <a class="anchor" href="#Documentation/git-tag.txt--a"></a>-a </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---annotate"> <a class="anchor" href="#Documentation/git-tag.txt---annotate"></a>--annotate </dt> <dd> <p>Make an unsigned, annotated tag object</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--s"> <a class="anchor" href="#Documentation/git-tag.txt--s"></a>-s </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---sign"> <a class="anchor" href="#Documentation/git-tag.txt---sign"></a>--sign </dt> <dd> <p>Make a GPG-signed tag, using the default e-mail address’s key. The default behavior of tag GPG-signing is controlled by <code>tag.gpgSign</code> configuration variable if it exists, or disabled otherwise. See <a href='/docs/git-config'>git-config[1]</a>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---no-sign"> <a class="anchor" href="#Documentation/git-tag.txt---no-sign"></a>--no-sign </dt> <dd> <p>Override <code>tag.gpgSign</code> configuration variable that is set to force each and every tag to be signed.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--ultkey-idgt"> <a class="anchor" href="#Documentation/git-tag.txt--ultkey-idgt"></a>-u <key-id> </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---local-userltkey-idgt"> <a class="anchor" href="#Documentation/git-tag.txt---local-userltkey-idgt"></a>--local-user=<key-id> </dt> <dd> <p>Make a GPG-signed tag, using the given key.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--f"> <a class="anchor" href="#Documentation/git-tag.txt--f"></a>-f </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---force"> <a class="anchor" href="#Documentation/git-tag.txt---force"></a>--force </dt> <dd> <p>Replace an existing tag with the given name (instead of failing)</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--d"> <a class="anchor" href="#Documentation/git-tag.txt--d"></a>-d </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---delete"> <a class="anchor" href="#Documentation/git-tag.txt---delete"></a>--delete </dt> <dd> <p>Delete existing tags with the given names.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--v"> <a class="anchor" href="#Documentation/git-tag.txt--v"></a>-v </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---verify"> <a class="anchor" href="#Documentation/git-tag.txt---verify"></a>--verify </dt> <dd> <p>Verify the GPG signature of the given tag names.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--nltnumgt"> <a class="anchor" href="#Documentation/git-tag.txt--nltnumgt"></a>-n<num> </dt> <dd> <p><num> specifies how many lines from the annotation, if any, are printed when using -l. Implies <code>--list</code>.</p> <div class="paragraph"> <p>The default is not to print any annotation lines. If no number is given to <code>-n</code>, only the first line is printed. If the tag is not annotated, the commit message is displayed instead.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--l"> <a class="anchor" href="#Documentation/git-tag.txt--l"></a>-l </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---list"> <a class="anchor" href="#Documentation/git-tag.txt---list"></a>--list </dt> <dd> <p>List tags. With optional <code><pattern>...</code>, e.g. <code>git tag --list 'v-*'</code>, list only the tags that match the pattern(s).</p> <div class="paragraph"> <p>Running "git tag" without arguments also lists all tags. The pattern is a shell wildcard (i.e., matched using fnmatch(3)). Multiple patterns may be given; if any of them matches, the tag is shown.</p> </div> <div class="paragraph"> <p>This option is implicitly supplied if any other list-like option such as <code>--contains</code> is provided. See the documentation for each of those options for details.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---sortltkeygt"> <a class="anchor" href="#Documentation/git-tag.txt---sortltkeygt"></a>--sort=<key> </dt> <dd> <p>Sort based on the key given. Prefix <code>-</code> to sort in descending order of the value. You may use the --sort=<key> option multiple times, in which case the last key becomes the primary key. Also supports "version:refname" or "v:refname" (tag names are treated as versions). The "version:refname" sort order can also be affected by the "versionsort.suffix" configuration variable. The keys supported are the same as those in <code>git for-each-ref</code>. Sort order defaults to the value configured for the <code>tag.sort</code> variable if it exists, or lexicographic order otherwise. See <a href='/docs/git-config'>git-config[1]</a>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---colorltwhengt"> <a class="anchor" href="#Documentation/git-tag.txt---colorltwhengt"></a>--color[=<when>] </dt> <dd> <p>Respect any colors specified in the <code>--format</code> option. The <code><when></code> field must be one of <code>always</code>, <code>never</code>, or <code>auto</code> (if <code><when></code> is absent, behave as if <code>always</code> was given).</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--i"> <a class="anchor" href="#Documentation/git-tag.txt--i"></a>-i </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---ignore-case"> <a class="anchor" href="#Documentation/git-tag.txt---ignore-case"></a>--ignore-case </dt> <dd> <p>Sorting and filtering tags are case insensitive.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---omit-empty"> <a class="anchor" href="#Documentation/git-tag.txt---omit-empty"></a>--omit-empty </dt> <dd> <p>Do not print a newline after formatted refs where the format expands to the empty string.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---columnltoptionsgt"> <a class="anchor" href="#Documentation/git-tag.txt---columnltoptionsgt"></a>--column[=<options>] </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---no-column"> <a class="anchor" href="#Documentation/git-tag.txt---no-column"></a>--no-column </dt> <dd> <p>Display tag listing in columns. See configuration variable <code>column.tag</code> for option syntax. <code>--column</code> and <code>--no-column</code> without options are equivalent to <em>always</em> and <em>never</em> respectively.</p> <div class="paragraph"> <p>This option is only applicable when listing tags without annotation lines.</p> </div> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---containsltcommitgt"> <a class="anchor" href="#Documentation/git-tag.txt---containsltcommitgt"></a>--contains [<commit>] </dt> <dd> <p>Only list tags which contain the specified commit (HEAD if not specified). Implies <code>--list</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---no-containsltcommitgt"> <a class="anchor" href="#Documentation/git-tag.txt---no-containsltcommitgt"></a>--no-contains [<commit>] </dt> <dd> <p>Only list tags which don’t contain the specified commit (HEAD if not specified). Implies <code>--list</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---mergedltcommitgt"> <a class="anchor" href="#Documentation/git-tag.txt---mergedltcommitgt"></a>--merged [<commit>] </dt> <dd> <p>Only list tags whose commits are reachable from the specified commit (<code>HEAD</code> if not specified).</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---no-mergedltcommitgt"> <a class="anchor" href="#Documentation/git-tag.txt---no-mergedltcommitgt"></a>--no-merged [<commit>] </dt> <dd> <p>Only list tags whose commits are not reachable from the specified commit (<code>HEAD</code> if not specified).</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---points-atltobjectgt"> <a class="anchor" href="#Documentation/git-tag.txt---points-atltobjectgt"></a>--points-at <object> </dt> <dd> <p>Only list tags of the given object (HEAD if not specified). Implies <code>--list</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--mltmsggt"> <a class="anchor" href="#Documentation/git-tag.txt--mltmsggt"></a>-m <msg> </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---messageltmsggt"> <a class="anchor" href="#Documentation/git-tag.txt---messageltmsggt"></a>--message=<msg> </dt> <dd> <p>Use the given tag message (instead of prompting). If multiple <code>-m</code> options are given, their values are concatenated as separate paragraphs. Implies <code>-a</code> if none of <code>-a</code>, <code>-s</code>, or <code>-u <key-id></code> is given.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--Fltfilegt"> <a class="anchor" href="#Documentation/git-tag.txt--Fltfilegt"></a>-F <file> </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---fileltfilegt"> <a class="anchor" href="#Documentation/git-tag.txt---fileltfilegt"></a>--file=<file> </dt> <dd> <p>Take the tag message from the given file. Use <em>-</em> to read the message from the standard input. Implies <code>-a</code> if none of <code>-a</code>, <code>-s</code>, or <code>-u <key-id></code> is given.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---trailerlttokengtltvaluegt"> <a class="anchor" href="#Documentation/git-tag.txt---trailerlttokengtltvaluegt"></a>--trailer <token>[(=|:)<value>] </dt> <dd> <p>Specify a (<token>, <value>) pair that should be applied as a trailer. (e.g. <code>git tag --trailer "Custom-Key: value"</code> will add a "Custom-Key" trailer to the tag message.) The <code>trailer.*</code> configuration variables (<a href='/docs/git-interpret-trailers'>git-interpret-trailers[1]</a>) can be used to define if a duplicated trailer is omitted, where in the run of trailers each trailer would appear, and other details. The trailers can be extracted in <code>git tag --list</code>, using <code>--format="%(trailers)"</code> placeholder.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt--e"> <a class="anchor" href="#Documentation/git-tag.txt--e"></a>-e </dt> <dt class="hdlist1" id="Documentation/git-tag.txt---edit"> <a class="anchor" href="#Documentation/git-tag.txt---edit"></a>--edit </dt> <dd> <p>The message taken from file with <code>-F</code> and command line with <code>-m</code> are usually used as the tag message unmodified. This option lets you further edit the message taken from these sources.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---cleanupltmodegt"> <a class="anchor" href="#Documentation/git-tag.txt---cleanupltmodegt"></a>--cleanup=<mode> </dt> <dd> <p>This option sets how the tag message is cleaned up. The <em><mode></em> can be one of <em>verbatim</em>, <em>whitespace</em> and <em>strip</em>. The <em>strip</em> mode is default. The <em>verbatim</em> mode does not change message at all, <em>whitespace</em> removes just leading/trailing whitespace lines and <em>strip</em> removes both whitespace and commentary.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---create-reflog"> <a class="anchor" href="#Documentation/git-tag.txt---create-reflog"></a>--create-reflog </dt> <dd> <p>Create a reflog for the tag. To globally enable reflogs for tags, see <code>core.logAllRefUpdates</code> in <a href='/docs/git-config'>git-config[1]</a>. The negated form <code>--no-create-reflog</code> only overrides an earlier <code>--create-reflog</code>, but currently does not negate the setting of <code>core.logAllRefUpdates</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt---formatltformatgt"> <a class="anchor" href="#Documentation/git-tag.txt---formatltformatgt"></a>--format=<format> </dt> <dd> <p>A string that interpolates <code>%(fieldname)</code> from a tag ref being shown and the object it points at. The format is the same as that of <a href='/docs/git-for-each-ref'>git-for-each-ref[1]</a>. When unspecified, defaults to <code>%(refname:strip=2)</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt-lttagnamegt"> <a class="anchor" href="#Documentation/git-tag.txt-lttagnamegt"></a><tagname> </dt> <dd> <p>The name of the tag to create, delete, or describe. The new tag name must pass all checks defined by <a href='/docs/git-check-ref-format'>git-check-ref-format[1]</a>. Some of these checks may restrict the characters allowed in a tag name.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt-ltcommitgt"> <a class="anchor" href="#Documentation/git-tag.txt-ltcommitgt"></a><commit> </dt> <dt class="hdlist1" id="Documentation/git-tag.txt-ltobjectgt"> <a class="anchor" href="#Documentation/git-tag.txt-ltobjectgt"></a><object> </dt> <dd> <p>The object that the new tag will refer to, usually a commit. Defaults to HEAD.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_configuration"><a class="anchor" href="#_configuration"></a>CONFIGURATION</h2> <div class="sectionbody"> <div class="paragraph"> <p>By default, <em>git tag</em> in sign-with-default mode (-s) will use your committer identity (of the form <code>Your Name <your@email.address></code>) to find a key. If you want to use a different default key, you can specify it in the repository configuration as follows:</p> </div> <div class="listingblock"> <div class="content"> <pre>[user] signingKey = <gpg-key-id></pre> </div> </div> <div class="paragraph"> <p><code>pager.tag</code> is only respected when listing tags, i.e., when <code>-l</code> is used or implied. The default is to use a pager. See <a href='/docs/git-config'>git-config[1]</a>.</p> </div> </div> </div> <div class="sect1"> <h2 id="_discussion"><a class="anchor" href="#_discussion"></a>DISCUSSION</h2> <div class="sectionbody"> <div class="sect2"> <h3 id="_on_re_tagging"><a class="anchor" href="#_on_re_tagging"></a>On Re-tagging</h3> <div class="paragraph"> <p>What should you do when you tag a wrong commit and you would want to re-tag?</p> </div> <div class="paragraph"> <p>If you never pushed anything out, just re-tag it. Use "-f" to replace the old one. And you’re done.</p> </div> <div class="paragraph"> <p>But if you have pushed things out (or others could just read your repository directly), then others will have already seen the old tag. In that case you can do one of two things:</p> </div> <div class="olist arabic"> <ol class="arabic"> <li> <p>The sane thing. Just admit you screwed up, and use a different name. Others have already seen one tag-name, and if you keep the same name, you may be in the situation that two people both have "version X", but they actually have <em>different</em> "X"'s. So just call it "X.1" and be done with it.</p> </li> <li> <p>The insane thing. You really want to call the new version "X" too, <em>even though</em> others have already seen the old one. So just use <em>git tag -f</em> again, as if you hadn’t already published the old one.</p> </li> </ol> </div> <div class="paragraph"> <p>However, Git does <strong>not</strong> (and it should not) change tags behind users back. So if somebody already got the old tag, doing a <em>git pull</em> on your tree shouldn’t just make them overwrite the old one.</p> </div> <div class="paragraph"> <p>If somebody got a release tag from you, you cannot just change the tag for them by updating your own one. This is a big security issue, in that people MUST be able to trust their tag-names. If you really want to do the insane thing, you need to just fess up to it, and tell people that you messed up. You can do that by making a very public announcement saying:</p> </div> <div class="listingblock"> <div class="content"> <pre>Ok, I messed up, and I pushed out an earlier version tagged as X. I then fixed something, and retagged the *fixed* tree as X again. If you got the wrong tag, and want the new one, please delete the old one and fetch the new one by doing: git tag -d X git fetch origin tag X to get my updated tag. You can test which tag you have by doing git rev-parse X which should return 0123456789abcdef.. if you have the new version. Sorry for the inconvenience.</pre> </div> </div> <div class="paragraph"> <p>Does this seem a bit complicated? It <strong>should</strong> be. There is no way that it would be correct to just "fix" it automatically. People need to know that their tags might have been changed.</p> </div> </div> <div class="sect2"> <h3 id="_on_automatic_following"><a class="anchor" href="#_on_automatic_following"></a>On Automatic following</h3> <div class="paragraph"> <p>If you are following somebody else’s tree, you are most likely using remote-tracking branches (eg. <code>refs/remotes/origin/master</code>). You usually want the tags from the other end.</p> </div> <div class="paragraph"> <p>On the other hand, if you are fetching because you would want a one-shot merge from somebody else, you typically do not want to get tags from there. This happens more often for people near the toplevel but not limited to them. Mere mortals when pulling from each other do not necessarily want to automatically get private anchor point tags from the other person.</p> </div> <div class="paragraph"> <p>Often, "please pull" messages on the mailing list just provide two pieces of information: a repo URL and a branch name; this is designed to be easily cut&pasted at the end of a <em>git fetch</em> command line:</p> </div> <div class="listingblock"> <div class="content"> <pre>Linus, please pull from git://git..../proj.git master to get the following updates...</pre> </div> </div> <div class="paragraph"> <p>becomes:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ git pull git://git..../proj.git master</pre> </div> </div> <div class="paragraph"> <p>In such a case, you do not want to automatically follow the other person’s tags.</p> </div> <div class="paragraph"> <p>One important aspect of Git is its distributed nature, which largely means there is no inherent "upstream" or "downstream" in the system. On the face of it, the above example might seem to indicate that the tag namespace is owned by the upper echelon of people and that tags only flow downwards, but that is not the case. It only shows that the usage pattern determines who are interested in whose tags.</p> </div> <div class="paragraph"> <p>A one-shot pull is a sign that a commit history is now crossing the boundary between one circle of people (e.g. "people who are primarily interested in the networking part of the kernel") who may have their own set of tags (e.g. "this is the third release candidate from the networking group to be proposed for general consumption with 2.6.21 release") to another circle of people (e.g. "people who integrate various subsystem improvements"). The latter are usually not interested in the detailed tags used internally in the former group (that is what "internal" means). That is why it is desirable not to follow tags automatically in this case.</p> </div> <div class="paragraph"> <p>It may well be that among networking people, they may want to exchange the tags internal to their group, but in that workflow they are most likely tracking each other’s progress by having remote-tracking branches. Again, the heuristic to automatically follow such tags is a good thing.</p> </div> </div> <div class="sect2"> <h3 id="_on_backdating_tags"><a class="anchor" href="#_on_backdating_tags"></a>On Backdating Tags</h3> <div class="paragraph"> <p>If you have imported some changes from another VCS and would like to add tags for major releases of your work, it is useful to be able to specify the date to embed inside of the tag object; such data in the tag object affects, for example, the ordering of tags in the gitweb interface.</p> </div> <div class="paragraph"> <p>To set the date used in future tag objects, set the environment variable GIT_COMMITTER_DATE (see the later discussion of possible values; the most common form is "YYYY-MM-DD HH:MM").</p> </div> <div class="paragraph"> <p>For example:</p> </div> <div class="listingblock"> <div class="content"> <pre>$ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1</pre> </div> </div> </div> </div> </div> <div class="sect1"> <h2 id="_date_formats"><a class="anchor" href="#_date_formats"></a>DATE FORMATS</h2> <div class="sectionbody"> <div class="paragraph"> <p>The <code>GIT_AUTHOR_DATE</code> and <code>GIT_COMMITTER_DATE</code> environment variables support the following date formats:</p> </div> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-tag.txt-Gitinternalformat"> <a class="anchor" href="#Documentation/git-tag.txt-Gitinternalformat"></a>Git internal format </dt> <dd> <p>It is <code><unix-timestamp> <time-zone-offset></code>, where <code><unix-timestamp></code> is the number of seconds since the UNIX epoch. <code><time-zone-offset></code> is a positive or negative offset from UTC. For example CET (which is 1 hour ahead of UTC) is <code>+0100</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt-RFC2822"> <a class="anchor" href="#Documentation/git-tag.txt-RFC2822"></a>RFC 2822 </dt> <dd> <p>The standard date format as described by RFC 2822, for example <code>Thu, 07 Apr 2005 22:13:13 +0200</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-tag.txt-ISO8601"> <a class="anchor" href="#Documentation/git-tag.txt-ISO8601"></a>ISO 8601 </dt> <dd> <p>Time and date specified by the ISO 8601 standard, for example <code>2005-04-07T22:13:13</code>. The parser accepts a space instead of the <code>T</code> character as well. Fractional parts of a second will be ignored, for example <code>2005-04-07T22:13:13.019</code> will be treated as <code>2005-04-07T22:13:13</code>.</p> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <div class="title">Note</div> </td> <td class="content"> In addition, the date part is accepted in the following formats: <code>YYYY.MM.DD</code>, <code>MM/DD/YYYY</code> and <code>DD.MM.YYYY</code>. </td> </tr> </table> </div> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_files"><a class="anchor" href="#_files"></a>FILES</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-tag.txt-codeGITDIRTAGEDITMSGcode"> <a class="anchor" href="#Documentation/git-tag.txt-codeGITDIRTAGEDITMSGcode"></a><code>$GIT_DIR/TAG_EDITMSG</code> </dt> <dd> <p>This file contains the message of an in-progress annotated tag. If <code>git tag</code> exits due to an error before creating an annotated tag then the tag message that has been provided by the user in an editor session will be available in this file, but may be overwritten by the next invocation of <code>git tag</code>.</p> </dd> </dl> </div> </div> </div> <div class="sect1"> <h2 id="_notes"><a class="anchor" href="#_notes"></a>NOTES</h2> <div class="sectionbody"> <div class="paragraph"> <p>When combining multiple <code>--contains</code> and <code>--no-contains</code> filters, only references that contain at least one of the <code>--contains</code> commits and contain none of the <code>--no-contains</code> commits are shown.</p> </div> <div class="paragraph"> <p>When combining multiple <code>--merged</code> and <code>--no-merged</code> filters, only references that are reachable from at least one of the <code>--merged</code> commits and from none of the <code>--no-merged</code> commits are shown.</p> </div> </div> </div> <div class="sect1"> <h2 id="_see_also"><a class="anchor" href="#_see_also"></a>SEE ALSO</h2> <div class="sectionbody"> <div class="paragraph"> <p><a href='/docs/git-check-ref-format'>git-check-ref-format[1]</a>. <a href='/docs/git-config'>git-config[1]</a>.</p> </div> </div> </div> <div class="sect1"> <h2 id="_git"><a class="anchor" href="#_git"></a>GIT</h2> <div class="sectionbody"> <div class="paragraph"> <p>Part of the <a href='/docs/git'>git[1]</a> suite</p> </div> </div> </div> <h3 hidden="true" data-pagefind-weight="10">tag</h3> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>