From: Andreas Schwab <schwab@linux-m68k.org>
To: Jeff King <peff@peff.net>
Cc: crstml@libero.it, git@vger.kernel.org
Subject: Re: connecting the local main branch to the remote origin/main without pushing
Date: Sat, 28 Dec 2024 20:39:55 +0100 [thread overview]
Message-ID: <87cyhbk35g.fsf@igel.home> (raw)
In-Reply-To: <20241228190827.GB815586@coredump.intra.peff.net> (Jeff King's message of "Sat, 28 Dec 2024 14:08:27 -0500")
On Dez 28 2024, Jeff King wrote:
> On Sat, Dec 28, 2024 at 06:15:01PM +0100, Andreas Schwab wrote:
>
>> On Dez 28 2024, crstml@libero.it wrote:
>>
>> > 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).
That does not work if origin/main does not exist yet.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2024-12-28 19:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-28 15:47 connecting the local main branch to the remote origin/main without pushing crstml
2024-12-28 16:11 ` rsbecker
2024-12-29 9:01 ` crstml
2024-12-28 17:15 ` Andreas Schwab
2024-12-28 17:20 ` Junio C Hamano
2024-12-28 19:08 ` Jeff King
2024-12-28 19:39 ` Andreas Schwab [this message]
2024-12-29 10:01 ` crstml
2024-12-29 14:39 ` rsbecker
2024-12-29 10:03 ` crstml
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cyhbk35g.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=crstml@libero.it \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).