Post by Shawn O. PearcePost by s***@gmail.comIs 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 su=
re
Post by Shawn O. PearceIf the tag still exists, `git fsck --unreachable | grep tag` should
show you output listing the dangling tag objects. =C2=A0Once you have=
that
Post by Shawn O. Pearcelist, use `git show SHA1` to view the object. =C2=A0When you find the=
tag,
Post by Shawn O. Pearcemake a reference to it with `git update-ref refs/tags/NAME SHA1`.
Thanks, that worked.
One thing I noticed that I wasn't sure about is that I SSH'd into the
server and ran git update-ref to restore the tag. That created the
symbolic name in .git/refs/tags/NAME to point to that tag object. But
what I noticed is that the only file listed in .git/refs/tags is the
tag I restored. There are other tags in the repository (and a fresh
clone gets them), but they don't show up in that directory. Is it
going to be a problem that ran git update-ref on the server (which is
a bare repository) rather than on a clone that I push? I just want to
make sure that the tag objects are referenced so they don't go away
after the 2 week garbage collection grace period.