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

Re: can I remove or move a tag in a remote repository?

From
Andreas Ericsson <ae@op5.se>
Date
Nov 28, 2006, 11:08 UTC
Message-ID
<456C1891.80706@op5.se>
In-Reply-To
<87wt5rffbm.fsf@rho.meyering.net>
Jim Meyering wrote:
> 
> Perhaps I shouldn't push the cvs-head tag at all.

Possibly not, although it's nice to let others that use git to know where you've cut the release.

> A few questions:
>   - is there a way to say "push all tags matching /COREUTILS-*/"
>       or to say "push all tags, except the ones on this list"?

Here's a snippet from the default update hook we use on all our repos. We explicitly deny any non-annotated tags from being pushed to the central server and let rogue devs know why the push failed by writing the error message to stderr so that it gets sent over the wire. I believe this is still the default update-hook shipped with git. ---%<---%<----%<--- ref_type=$(git cat-file -t "$3")

# Only allow annotated tags in a shared repo
# Remove this code to treat dumb tags the same as everything else
case "$1","$ref_type" in
refs/tags/*,commit)
     echo "*** Un-annotated tags are not allowed in this repo" >&2
     echo "*** Use 'git tag [ -a | -s ]' for tags you want to 
propagate." >&2
     exit 1;;
---%<---%<---%<---
Show 6 quoted lines
>   - is there a way to remove the cvs-head tag from the remote directory?
>       Note: I don't have shell access there.  I can request that someone
>       with shell access do it, but shouldn't have to resort to that.
>   - is there some way to make "git push" do what I want, and update the
>       offending tag in the remote repo?
> 

I'm not sure if execution reaches the update hook when you're uploading a tag that already exists. If it is, you could simply remove the offending tag in the update-hook and exit 0 to make it work properly. You can test this without shell-access on the remote system by setting up a repo on your local machine, making some dummy commit, cloning it and then hacking away on the hook while pushing to it from your local repo.

Other than that, push your tags manually by naming them explicitly on the push-line, like so: $ git push $remote_repo $tag_name

This is what I do whenever we cut a release. With a one tag per release, it's not very troublesome at all, and the update-hook sends a nicely formatted message of the changes since the last release (last tag really, but it amounts to the same thing for us) to everyone involved.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Previous: Jakub NarebskiNext: Junio C Hamano
Message 3 of 9 in “can I remove or move a tag in a remote repository?”
  1. Jim MeyeringNov 19, 2006
  2. Jakub NarebskiNov 19, 2006
  3. Andreas EricssonNov 28, 2006
  4. Junio C HamanoNov 28, 2006
  5. Johannes SchindelinNov 29, 2006
  6. Jim MeyeringNov 29, 2006
  7. Johannes SchindelinNov 29, 2006
  8. Jakub NarebskiNov 29, 2006
  9. Andy WhitcroftNov 29, 2006

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.