git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: how to rename remote branches, the long way

From
Antoine Beaupré <anarcat@debian.org>
Date
Apr 24, 2021, 01:12 UTC
Message-ID
<87k0osfpt8.fsf@angela.anarc.at>
In-Reply-To
<60836fa129078_ff602089c@natae.notmuch>
On 2021-04-23 20:08:49, Felipe Contreras wrote:
Show 12 quoted lines
> 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?
Show 9 quoted lines
>> 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 actually did this, when it started working:

    git config --global init.defaultbranch main
And the reason I wrote this is to fix legacy.
A.
-- 
In god we trust, others pay cash.
                        - Richard Desjardins, Miami
Previous: Felipe ContrerasNext: Felipe Contreras
Message 3 of 10 in “how to rename remote branches, the long way”
  1. Antoine BeaupréApr 24, 2021
  2. Felipe ContrerasApr 24, 2021
  3. Antoine BeaupréApr 24, 2021
  4. Felipe ContrerasApr 24, 2021
  5. Antoine BeaupréApr 24, 2021
  6. Felipe ContrerasApr 29, 2021
  7. brian m. carlsonApr 24, 2021
  8. Felipe ContrerasApr 29, 2021
  9. brian m. carlsonApr 24, 2021
  10. Antoine BeaupréApr 24, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.