Git 3.0 将使用 main 作为默认分支。
Git 3.0 will use main as the default branch

原始链接: https://thoughtbot.com/blog/git-3-0-will-use-main-as-the-default-branch

从 Git 3.0 开始,预计在 2026 年底发布,新的仓库将默认使用“main”作为初始分支名称,而不是“master”。这一变化由软件自由保护协会于 2020 年宣布,并已被 GitHub 等平台采用,旨在推广包容性语言。 Git 3.0 还将包含重要的技术更新。这些更新包括通过将默认哈希函数从 SHA-1 切换到 SHA-256 来增强安全性,使用新的默认存储格式来提高在 macOS 和 Windows 上的性能和兼容性,以及进一步将 Rust 编程语言集成到 Git 的构建过程中。这些更新代表了广泛使用的版本控制系统的一次重大发展。

Git 3.0 宣布默认分支名称从“master”改为“main”引发了 Hacker News 的讨论,社区对此存在分歧。虽然此举旨在采用更具包容性的语言,但许多评论者表达了对政治正确性渗透到技术领域的沮丧。 争论范围从支持该更改作为一种善意行为,到批评其屈从于敏感性,牺牲了实用性和全球包容性——一些人指出,将以美国为中心的社会问题应用于全球开发者社区的讽刺意味。 除了命名辩论之外,评论者也承认 Git 3.0 中更重要的技术改进,包括转向 SHA-256 以提高安全性、存储格式更改以提高性能以及引入 Rust。然而,分支名称更改主导了讨论,凸显了科技界内部围绕社会问题的持续紧张关系。
相关文章

原文

Starting with Git 3.0, developers will no longer have to configure the default branch for new repositories.

Git 2.52, released this week, includes this small but meaningful line in the patch notes:

Declare that “git init” that is not otherwise configured uses ‘main’ as the initial branch, not ‘master’, starting Git 3.0.

This change has been a long time coming. The Software Freedom Conservancy—the nonprofit home of the Git project—said in June 23, 2020 that Git would eventually update its default branch name. GitHub followed soon after, changing its default branch for new repositories to main on October 1, 2020.

Git 3.0 has no planned release date as of now, but current estimates put it near the end of 2026.

Other notable changes planned for 3.0 include:

  • Changing the default hash function from SHA-1 to SHA-256, improving security.
  • Changing the default storage format to better support macOS and Windows, and to improve performance.
  • More formally integrating Rust into Git’s own build process

About thoughtbot

We've been helping engineering teams deliver exceptional products for over 20 years. Our designers, developers, and product managers work closely with teams to solve your toughest software challenges through collaborative design and development. Learn more about us.

联系我们 contact @ memedata.com