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

Re: git-push [--all] and tags

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Oct 7, 2007, 01:26 UTC
Message-ID
<alpine.LFD.0.999.0710061814310.23684@woody.linux-foundation.org>
In-Reply-To
<47083035.7070904@vilain.net>
On Sun, 7 Oct 2007, Sam Vilain wrote:
Show 5 quoted lines
>
> Think is, pushing tags is considered to be something that needs to be
> done very explicitly; the convention, after all, is that published tags
> are forever.  Whereas branches change all the time.  So, pushing tags
> should require an extra flag.
Well, I agrewe with Martin, and I think you missed his point.

Sure, pushing tags should require you to say so explicitly, but right now you cannot (for example) push *both* the common branches *and* tags easily.

You can do
	git push
to push common branches, and you can do
	git push --tags

to push tags, but there's no way to say "push both the common branches _and_ all tags".

(And the same is true of "--all" and "--tags").
So I do think Martin is right. I think we should:
 - make sure that "--all --tags" DTRT, namely send all branches and all 
   tags. Right now they are actually very similar things (one works on 
   "refs/heads", while the other works on "refs/tags"), but they are 
   implemented using *totally* different logic, and they don't work 
   together.
 - I think it would be a good idea to implement a "--shared" flag, which 
   is the current default behavior when there are no command line flags, 
   and there are no listed branches to push in the config file. That would 
   allow doing "git push --shared --tags" to update shared branches _and_ 
   tags, but it would probably *also* make it easier to explain the 
   default behaviour of "git push", by making the behavior more explicit.
   (IOW, you can introduce the notion of "--shared updates all branches 
   that exists both locally and remotely under the same names" separately 
   early on as a command line option, and then later just explain that if 
   there is nothing else telling git what to push, it will default to 
   that shared branch behavior)

Hmm? I do agree with "git push" as it now stands has a lot of warts, although I don't really agree with the people who want to change the default behavior.

			Linus
Previous: Sam VilainNext: martin f krafft
Message 3 of 5 in “git-push [--all] and tags”
  1. martin f krafftOct 6, 2007
  2. Sam VilainOct 7, 2007
  3. Linus TorvaldsOct 7, 2007
  4. martin f krafftOct 7, 2007
  5. Linus TorvaldsOct 7, 2007

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.