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

Re: Restore annotated tag?

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 22, 2010, 18:23 UTC
Message-ID
<20100922182353.GO32601@spearce.org>
In-Reply-To
<AANLkTinafiikD0Lzgw2gw1ti2pCK6cSTk5bQZFcCRJnS@mail.gmail.com>
skillzero@gmail.com wrote:
> Is there a way to restore an annotated tag? One was accidentally
> deleted and pushed. I can restore normal tags by just using git tag
> again, but for an annotated tag, there's a tag object and I'm not sure
> how to restore it.

If the tag still exists, `git fsck --unreachable | grep tag` should show you output listing the dangling tag objects. Once you have that list, use `git show SHA1` to view the object. When you find the tag, make a reference to it with `git update-ref refs/tags/NAME SHA1`.

-- 
Shawn.
Previous: skillzero@gmail.comNext: skillzero@gmail.com
Message 2 of 4 in “Restore annotated tag?”
  1. skillzero@gmail.comSep 22, 2010
  2. Shawn O. PearceSep 22, 2010
  3. skillzero@gmail.comSep 22, 2010
  4. Shawn O. PearceSep 22, 2010

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.