如何从master更改git default分支

本文介绍了如何将git的默认分支master重命名为default,包括更改本地和远程分支名称、设置新分支的远程上游跟踪以及在GitHub等仓库主机上更新名称。同时,还提供了已经使用仓库的人进行相应更改的步骤。
摘要由CSDN通过智能技术生成

Recently, there are many suggestions about renaming the default branch master to some other name. This was mainly due to the master-slave metaphor.

最近,有许多关于将默认分支主机重命名为其他名称的建议。 这主要是由于主从比喻。

There is evidence that states it was intended to mention master-copy or master recording. And it is not intended to be master-slave.

证据表明它打算提及原件原件录音。 并且它不打算成为主从。

But I think it’s people’s perspective, and they should be empowered to make this change.

但是我认为这是人们的观点,应该授权他们进行此更改。

So let’s see how to change the default git branch master to default (you can use your preferred name)

因此,让我们来看看如何将默认的git branch master更改为default (可以使用您的首选名称)

Before starting I have to tell you that I have tried this in multiple repos and it’s working fine without any breaking changes. If you are not confident enough then fork your repo and try it first.

在开始之前,我必须告诉您我已经在多个存储库中尝试了此操作,并且在没有任何重大更改的情况下工作正常。 如果您没有足够的信心,请先分叉您的仓库,然后再尝试。

先决条件 (Prerequisites)

  1. Make sure your CI/CD flow doesn’t get interrupted.

    确保您的CI / CD流不会中断。
  2. Make sure you have merged all the PRs targeting master. Other PRs are fine

    确保您已合并所有PR定位母版。 其他公关很好

重命名默认分支需要三个步骤 (There are three steps in renaming the default branch

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值