简体   繁体   English

如何更改 Azure DevOps 主机 Git Repo 的默认分支名称

[英]How to change default branch name for Azure DevOps host Git Repo

Unlike many organizations, our company use product's name as main/default branch.与许多组织不同,我们公司使用产品名称作为主要/默认分支。 For now, it's still master by default when we create a new Git Repo in Azure DevOps.目前,当我们在 Azure DevOps 中创建新的 Git 存储库时,默认情况下它仍然是master

We have noticed this is available in GitHub-- Renaming the default branch from master .我们注意到这在 GitHub 中是可用的——从 master 重命名默认分支

Many communities, both on GitHub and in the wider Git community, are considering renaming the default branch name of their repository from master.许多社区,包括 GitHub 和更广泛的 Git 社区,都在考虑从 master 重命名其存储库的默认分支名称。 GitHub is gradually renaming the default branch of our own repositories from master to main. GitHub 正在逐步将我们自己的存储库的默认分支从 master 重命名为 main。

How could we do the same thing in Azure DevOps?我们如何在 Azure DevOps 中做同样的事情?

Yes, this is possible.是的,这是可能的。 Please check this link .请检查此链接 You must go to repository settings and change accordingly to your preferences.您必须转到存储库设置并根据您的偏好进行相应更改。

在此处输入图片说明

Your could choice any name of initial branches at present.您现在可以选择任何名称的初始分支。

Beginning with sprint 176's deployment, folks with Edit policies at the project level may choose the name of the initial branch for new repositories in that project.从 sprint 176 的部署开始,在项目级别具有编辑策略的人员可以为该项目中的新存储库选择初始分支的名称。 The setting won't change anything for existing, populated repositories.该设置不会更改现有的填充存储库的任何内容。 在此处输入图片说明

It will change the first branch created when you click New repository or when you initialize an empty repository.当您单击新建存储库或初​​始化空存储库时,它将更改创建的第一个分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM