Skip to content

Latest commit

 

History

History
42 lines (22 loc) · 1.9 KB

change-default-branch-instructions.md

File metadata and controls

42 lines (22 loc) · 1.9 KB
ms.topic
include

You can use a branch other than main for new changes or change your main line of development in your repo. To change the default branch name for new repositories, see All repositories settings and policies.

To change your repo's default branch for merging new pull requests, you need at least two branches. If there's only one branch, it's already the default. You must create a second branch to change the default.

Note

Changing the default branch requires you to have Edit policies permission. For more information, see Set Git repository permissions.

::: moniker range=">= azure-devops-2020"

  1. Under your project repo, select Branches.

  2. On the Branches page, select More options next to the new default branch you want, and choose Set as default branch.

    Screenshot that shows Set default branch.

  3. After you set the new default branch, you can delete the previous default if you want.

::: moniker-end

::: moniker range="azure-devops-2019"

  1. Select the settings button in your project bottom-left corner to open the project administration page.

    Open the administrative area of the web portal for your project

  2. Select Repositories.

  3. Select your Git repository. Your branches are displayed under your repo.

  4. Select the ... next to the branch you want to set as default, then select Set as default branch.

    Set a default branch for a Git repo

  5. Once you've set the new default branch, you may delete the previous one if you want.

::: moniker-end