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

Re: [RFD] what should "git push remote.host:path" do?

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 12, 2006, 18:10 UTC
Message-ID
<Pine.LNX.4.64.0601121006040.3535@g5.osdl.org>
In-Reply-To
<7vslrtq05h.fsf@assigned-by-dhcp.cox.net>
On Thu, 12 Jan 2006, Junio C Hamano wrote:
Show 6 quoted lines
> 
> Nevertheless, exposing the default behaviour of "git send-pack"
> to "git push" was probably a mistake.  I'd propose to require at
> least one refspec to be specified, either on the command line or
> via $GIT_DIR/remotes mechanism.  So my answer to the "Subject: "
> line question is "Barf".

Well, I don't have objections, but from ym usage schenario, I'd at least then want flags for "all tags" (--tags - like "pull") and "all branches" (--all).

Having to list all tags/branches is slightly painful. I currently push out all my tags with

	./push-all $(cd .git/refs ; find -type f tags)

which works but isn't exactly user-friendly ("push-all" is just a script that uses "git push" to push to multiple repositories).

Show 7 quoted lines
> Unlike pull that can happen pretty much promiscuously, people
> will push into the same set of a limited number of remote
> repositories repeatedly over the life of the project, so it is
> reasonable to assume they would want to keep a $GIT_DIR/remotes/
> entry for those repositories to save typing.  Then always
> requiring one or more refspecs for push is not too much to ask
> for.

Well, especially if you want to use "git push" to basically back up your own repo, you do want the "--all" flag. Otherwise you will then forget to add a branch name to every remotes file whenyou create a new branch.

		Linus
Previous: Nick HengeveldNext: Junio C Hamano
Message 5 of 7 in “[RFD] what should "git push remote.host:path" do?”
  1. Junio C HamanoJan 12, 2006
  2. SeanJan 12, 2006
  3. Junio C HamanoJan 12, 2006
  4. Nick HengeveldJan 12, 2006
  5. Linus TorvaldsJan 12, 2006
  6. Junio C HamanoJan 12, 2006
  7. git-push: avoid falling back on pushing "matching" refs.Junio C Hamano, Jan 13, 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.