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

Re: BUG: For first push to a bare repo, using "--tags" prevents creation of master branch

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 29, 2015, 05:35 UTC
Message-ID
<vpqbnh4hro7.fsf@anie.imag.fr>
In-Reply-To
<CABRuA+iVRZR9SxvYVCO5zd0hZEbn6tioyP6dZ5xSbaAeNF4w+w@mail.gmail.com>
Michael Darling <darlingm@gmail.com> writes:
> $ git push --tags --set-upstream origin
[...]
> Note this time there is NO:
>
>  * [new branch]      master -> master
> Branch master set up to track remote branch master from origin.
man git-push says:
SYNOPSIS
       git push [...] [<repository> [<refspec>...]]
[...]
       --tags
           All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command
           line.

You did not provide any refspec (you provided <repository> but not <refspec>), hence --tags pushes only tags. So, this is the expected behavior.

That said, we may want to add an option like --tags-also that would push tags _in addition_ to what would normally be pushed. --follow-tags does more or less this, though, but only for annotated tags pointing at a ref being pushed.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Michael DarlingNext: Junio C Hamano
Message 2 of 9 in “BUG: For first push to a bare repo, using "--tags" prevents creation of master branch”
  1. Michael DarlingMay 29, 2015
  2. Matthieu MoyMay 29, 2015
  3. Junio C HamanoMay 29, 2015
  4. Matthieu MoyMay 29, 2015
  5. Junio C HamanoMay 29, 2015
  6. Junio C HamanoMay 29, 2015
  7. Matthieu MoyMay 29, 2015
  8. Junio C HamanoMay 29, 2015
  9. Junio C HamanoJun 2, 2015

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.