好久没有在 github 上新建代码项目了,原因是担心服务器上拉取不稳定。但是,对于小程序项目就无所谓了,本地开发环境还是能保证 github 访问的。。。所以为了节省国内 git 仓库的额度,就在 github 私有仓库上存储小程序项目了。
突然发现熟悉的初始化流程变了!
> git remote add origin git@github.com:sunzhongwei/some_project.git
> git branch -M main
> git push -u origin main
多了一行 git branch -M main,隐隐感觉可能跟黑人敏感词 master 有关。
首先确认当前分支
> git branch
* main
果然,master 分支不见了,变成了 main。推测 -M 参数是用来分支改名的。
查看一下 git 文档:
git help branch
With a -m or -M option,
will be renamed to . If exists, -M must be used to force the rename to happen.
确实如此。
我并不觉得改了 master slave 的叫法就能消除种族歧视。似乎不改就要被谴责,这种逼迫程序员修改使用习惯的做法,完全是道德绑架。
master slave 的替代方案:
联系客服