RE: how to rename remote branches, the long way

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

>> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux