Setting a default branch

Last updated on
13 August 2023

To set a default branch for your project:

  1. On your project’s page, click on Source code to open Gitlab.
  2. In the left sidebar menu, under Settings, click on Repository.
  3. Expand the Branch defaults section and set the default branch.

To have access to the Settings menu option, you need to have both the “Administer maintainers” and the “Write to VCS” permissions for the project. Only people with the "Maintainer" role on Gitlab have the permission to access the repository settings.

If you have both those permissions, and still do not see the Settings menu option, ensure you are signed in to Gitlab by clicking on the Sign in link in the top right corner of the page.

The branch you choose will appear by default in your Version control instructions and will be checked out if a visitor clones the project without specifying a branch.

Help improve this page

Page status: No known problems

You can: