git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to create tags outside of refs/tags?

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2011, 23:52 UTC
Message-ID
<7vpqqlgd3q.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTi=CseZLobCoq+Li0AexHR+eaZpe84DG5hGzWHzR@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
Show 11 quoted lines
> On Mon, Feb 21, 2011 at 12:21 PM, Christian Halstrick
> <christian.halstrick@gmail.com> wrote:
>> I would like to create a tag which full name is not starting with
>> refs/tags. Is that possible with 'git tag'?
>
> Nope.
>
>> If not, is there any other command to create such tags?
>
> If it's just a light-weight tag, you can use the low-level (plumbing)
> command update-ref to create an arbitrary ref:

That is a very unfriendly answer. You shouldn't be answering everybody who ask "How do I shoot my foot off? git-foo command does not seem to let me do so" with "Here is how to do that".

> $ git update-ref refs/blargh HEAD

At least, please say "that thing is no longer a tag, many git commands would complain because refs/blargh does not have two-levels, and do not ever think about starting that thing without 'refs/', or your 'gc' may end up losing that object" when you give a potentially dangerous hint like that (the last one being the most important).

Previous: Jay SoffianNext: Christian Halstrick
Message 3 of 16 in “How to create tags outside of refs/tags?”
  1. Christian HalstrickFeb 21, 2011
  2. Jay SoffianFeb 21, 2011
  3. Junio C HamanoFeb 21, 2011
  4. Christian HalstrickFeb 22, 2011
  5. Jeff KingFeb 22, 2011
  6. Junio C HamanoFeb 22, 2011
  7. Jeff KingFeb 22, 2011
  8. Jakub NarebskiFeb 22, 2011
  9. Jeff KingFeb 22, 2011
  10. Christian HalstrickFeb 22, 2011
  11. Junio C HamanoFeb 22, 2011
  12. Christian HalstrickFeb 22, 2011
  13. Michael J GruberFeb 23, 2011
  14. Christian HalstrickFeb 23, 2011
  15. Enrico WeigeltFeb 23, 2011
  16. Jay SoffianFeb 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.