git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* push.default and "git push"
@ 2022-11-28 21:32 Yuri Kanivetsky
  2022-11-29  1:28 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Yuri Kanivetsky @ 2022-11-28 21:32 UTC (permalink / raw)
  To: git

Hi,

I've been reading the documentation on git push lately, and there are
a couple of places I don't quite understand. From git-config:

> matching - push all branches having the same name on both ends. This makes the repository you are pushing to remember the set of branches that will be pushed out (e.g. if you always push maint and master there and no other branches, the repository you push to will have these two branches, and your local maint and master will be pushed there).

(1) What does "remember" exactly mean? Is this a round-about way to
say that when you push a branch it gets created? But no, it won't push
a branch, unless it exists remotely.

Actually I created a script to examine how these modes work:

https://gist.github.com/x-yuri/20f24f628db1bcbf272c055b33c18889

And from git-push:

> When the command line does not specify where to push with the <repository> argument, branch.*.remote configuration for the current branch is consulted to determine where to push. If the configuration is missing, it defaults to origin.

I've found that if there's no remote named "origin" it pushes to the
first remote. Or so it seems:

https://gist.github.com/x-yuri/888261d182fdab92040760138ea10a22

(2) I wonder if the documentation should be amended...

Regards,
Yuri

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-13 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-28 21:32 push.default and "git push" Yuri Kanivetsky
2022-11-29  1:28 ` Junio C Hamano
2024-12-13 12:20   ` Yuri Kanivetsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).