linux - Git init 仍然给我 master 而不是我配置中的默认分支名称(main)

标签 linux git ubuntu github

enter image description here
我是使用 Linux Ubuntu 的新手,我正在设置我的 git。我已经在 Windows 中使用过 git。我正在尝试将我的 git 默认分支设置为 main因为这是我在 windows 中习惯的,我在其他存储库中的所有分支也是 main .我已经尝试更改它一段时间了,但是 git init仍然给出 master 的默认分支.我还尝试给它一个默认的分支名称而不是 main但它仍然给主人。

最佳答案

init.defaultBranch是 Git 2.28 中的新配置键,因此您的 2.25 无法识别它。
您可以关注 this answer on Ask Ubuntu安装来自 Ubuntu Git 维护者的最新版本,以便使用配置。

关于linux - Git init 仍然给我 master 而不是我配置中的默认分支名称(main),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66409313/

相关文章:

linux - bash 中多个单词作为可能的变量

java - Tomcat 托管的 Web 应用程序链接在 Linux 中不起作用

git - CMake 外部项目 : how to specify relative path to the root CMakeLists. txt?

linux - BlueZ 兼容内核版本

linux - 明确要求 libssl.so.10 =>/usr/lib64/libssl.so.10 的应用程序

git rebase -i 快捷方式 - 找到最佳的 rebase 提交

git - 实际上用git pull

linux - 使用 ansible 安装驱动器时出现 "Not a directory"错误

ubuntu - 来自 Ubuntu 14.04 的 NGINX 1.4.7 与最新版本 NGINX 1.8.0

linux - "qemu-system-riscv: command not found"