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

Re: [PATCH] git builtin "push"

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 30, 2006, 20:07 UTC
Message-ID
<Pine.LNX.4.64.0604301303010.5231@g5.osdl.org>
In-Reply-To
<445516F5.1090204@garzik.org>
On Sun, 30 Apr 2006, Jeff Garzik wrote:
Show 9 quoted lines
> Linus Torvalds wrote:
> > Now, the reason I did it as a built-in is partly because it's yet another
> > step on relying less on shell, but it's actually mostly because I've wanted
> > to be able to push to _multiple_ repositories, and the most obvious and
> > simplest interface for that would seem be to just have a "remotes" file that
> > has multiple URL entries.
> 
> Thanks!  This is why I still use rsync, even though everybody and their mother
> tells me "Linus says rsync is deprecated."
No. You're using rsync because you're actively doing something _wrong_.
> Fact is, rsync is still the best to push a _bunch_ of branches, in the same
> tree, all in one command.

Not so. My builtin thing doesn't help at all, because it doesn't _need_ to help that case. You can already push as many branches as you want with the old "git push".

My builtin thing helps push to multiple _repositories_, not to multiple branches. I push out my stuff to two separate repos at master.kernel.org, and one at an osdl.org server machine, because if I lose my tree, I want to be sure I have alternate backups.

> In an attempt to get away from rsync, I even tried putting multiple 
> git:// entries into .git/remotes/origin, then doing "git push" with no 
> args, without success.
That's not how it works, and not how it has ever worked.
The way it works is that
	"git push repo"

with no branch specs will update all branches that are IN COMMON between your tree and the repository you're pushing to. In other words, it's meant to sync up the branches that you have already pushed.

If you want to push other branches, you need to do
	git push repo branch1 branch2 branch3 ...
or
	git push --all repo

where the latter does exactly what it says (use "--tags" instead of "--all" to just send all tags).

In all cases you will find that it's a hell of a lot more efficient than rsync ever has been.

		Linus
Previous: Jeff GarzikNext: sean
Message 5 of 9 in “git builtin "push"”
  1. git builtin "push"Linus Torvalds, Apr 30, 2006
  2. Junio C HamanoApr 30, 2006
  3. seanApr 30, 2006
  4. Jeff GarzikApr 30, 2006
  5. Linus TorvaldsApr 30, 2006
  6. seanApr 30, 2006
  7. Linus TorvaldsApr 30, 2006
  8. Junio C HamanoApr 30, 2006
  9. Jeff GarzikApr 30, 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.