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

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

From
Sean <seanlkml@sympatico.ca>
Date
Jan 12, 2006, 10:18 UTC
Message-ID
<BAYC1-PASMTP099ED34B41FFA02EDEEF25AE270@CEZ.ICE>
In-Reply-To
<7vslrtq05h.fsf@assigned-by-dhcp.cox.net>
On Thu, January 12, 2006 4:13 am, Junio C Hamano said:
> The underlying "git send-pack remote.host:path" pushes all the
> matching refs that both local and remote has, and "git push"
> blindly inherits this property.
[snip]
Show 9 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.
>
> Opinions?

What about assuming a refspec of "current-branch:current-branch" ? That is, if the branch name that is currently checked out locally also exists upstream, push into it (only if fast forward).

This should allow multiple branches to be updated locally, and pushed upstream selectively. If you force all push-refspecs to be listed in a remotes file, they'll all be updated every time you push and you'd lose the ability to push just one branch upstream without resorting to multiple $GIT_DIR/remotes/ entries.

Sean
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 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.