git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: "Antoine Beaupré" <anarcat@debian.org>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	git@vger.kernel.org
Subject: RE: how to rename remote branches, the long way
Date: Fri, 23 Apr 2021 22:44:34 -0500	[thread overview]
Message-ID: <60839422353fc_10cb9208c7@natae.notmuch> (raw)
In-Reply-To: <87k0osfpt8.fsf@angela.anarc.at>

Antoine Beaupré wrote:
> On 2021-04-23 20:08:49, Felipe Contreras wrote:
> > Antoine Beaupré wrote:
> >> Before people start throwing things (like `git push origin oldref:newref
> >> :oldref`) at me, consider that I've been beating my head against this
> >> for a while, and everywhere I look basically suggests this:
> >> 
> >>     git branch -m to_branch
> >>     git push origin from_branch:to_branch :from_branch
> >
> > Better:
> >
> >   git push origin from_branch:to_branch :from_branch &&
> >   git branch -m from_branch to_branch
> 
> How so?

If the remote branch can't be renamed, then the local branch isn't
renamed either.

> >> I wrote this primarily with the "master to main" migration, because a
> >> bunch of projects (including mine) are suddenly, actually migrating
> >> their main branch from master to main. Personnally, it's because I'm
> >> tired of being yelled "master" from my shell prompt all the time, but
> >> naturally, I guess opinions on the matter vary.
> >
> > Just tell git to stop bothering you:
> >
> >   git config --global init.defaultbranch master
> 
> I think you misunderstood me; I am tired of seeing the name "master"
> everywhere.

I see.

That makes me think we might want a converter that translates
(local)main -> (remote)master, and (remote)master -> (local)mail
everywhere, so if your eyes have trouble seeing one, you can configure
git to simply see the other... Without bothering the rest of the word.

I'll give that idea a try.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2021-04-24  3:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  0:22 how to rename remote branches, the long way Antoine Beaupré
2021-04-24  1:08 ` Felipe Contreras
2021-04-24  1:12   ` Antoine Beaupré
2021-04-24  3:44     ` Felipe Contreras [this message]
2021-04-24 15:05       ` Antoine Beaupré
2021-04-29  0:23         ` Felipe Contreras
2021-04-24 18:24       ` brian m. carlson
2021-04-29  0:28         ` Felipe Contreras
2021-04-24 17:38 ` brian m. carlson
2021-04-24 18:03   ` Antoine Beaupré

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60839422353fc_10cb9208c7@natae.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=anarcat@debian.org \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).