Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] git builtin "push"

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:24


On Sun, 30 Apr 2006, Jeff Garzik wrote:
Linus Torvalds wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help