Skip to content

Unable to change Default Branch due to HEAD branch name

Summary

After updating the default branch from master and saving changes, the default branch is reverted immediately to master. This appears to be due to having a branch name HEAD. See #20474 (comment 215095866) for context.

Steps to reproduce

  1. Visit Settings->General->Expand image

  2. Under Default Branch, change the branch from master to any other existing branch

  3. Press "Save changes"

  4. Press "Expand" again, and see that the default branch is still master. Merge requests still default to master.

What is the current bug behavior?

Master remains the default branch.

What is the expected correct behavior?

The chosen default branch should become the new default.

Output of checks

This bug happens on GitLab.com

Possible fixes

This happened directly after we ran into the .lock issue described here https://gitlab.com/gitlab-com/support-forum/issues/1804. We filed a ticket to have our .lock file removed, and since then our default branch is locked to master.

Workarounds

Delete the branch name HEAD if not the default branch.

git push -d origin HEAD

Edited by 🤖 GitLab Bot 🤖