Skip to content

Mirrored repository does not respect "default" branch of source repository

Summary

When I create a new project and set it up as a mirror of a master project on another server, GitLab doesn't take over the "default branch" setting of the original. Instead it selects a random other branch. There are some side-effects too.

Steps to Reproduce

  • Create a new project
  • Setup hourly mirroring using a HTTPS URL (containing the default branch "master" and a branch "import")
  • Wait a few minutes
  • Go to project tab

Expected Results

  • The project tab shows the "master" branch
  • The project settings show "master" to be the default branch
  • The "master" branch is protected

Actual Results

  • The project tab shows the "import" branch
  • The project settings say that "import" is the default branch
  • The "import" branch is protected

Additional Details

The default branch chosen seems to be the first one of an alphabetical list.

Edited by 🤖 GitLab Bot 🤖