main branch:在版本控制(尤其是 Git)中指主分支/默认分支,通常保存项目的稳定主线代码,其他功能分支常从它创建并最终合并回它。(在一些平台上,“main branch”也用来替代较旧的 master branch 叫法。)
/meɪn bræntʃ/
/meɪn brɑːntʃ/
Push your changes to the main branch.
把你的更改推送到主分支。
Before merging, the team runs automated tests to ensure the feature branch won’t break the main branch of the repository.
在合并之前,团队会运行自动化测试,以确保功能分支不会破坏仓库的主分支。
main 来自古英语 mægen(力量、主要的),逐渐引申为“主要的”。branch 来自古法语 branche(树枝),引申为“分支”。在软件开发中,“branch(分支)”被借用来比喻代码从主线“分叉”的版本;“main branch(主分支)”作为术语在 Git 等工具与托管平台中普及,也与近年来将默认分支命名从 master 转向 main 的用法变化有关。