Thread (5 messages) 5 messages, 4 authors, 2024-12-29

Re: connecting the local main branch to the remote origin/main without pushing

From: Jeff King <hidden>
Date: 2024-12-28 19:08:28

On Sat, Dec 28, 2024 at 06:15:01PM +0100, Andreas Schwab wrote:
On Dez 28 2024, crstml@libero.it wrote:
quoted
My question is:
     Is it possible when applying the method 2 to have (without pushing)
     the local main branch connected to the remote origin/main branch as
     in the case of method 1 which by cloning connects these branches.
You can establish the effect by setting two config entries:

$ git config branch.main.remote origin
$ git config branch.main.merge refs/heads/main
Also:

  git branch --set-upstream-to=origin/main main

(sets the same config variables, but maybe a little more ergonomic).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help