Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

not able to save repo settings because main branch is not an option

Deleted user July 11, 2024

Hi, I am not able to modify and save an existing repo settings because when I try to save I get a message:

"Please fix errors below Main branch needs your attention"

Under main branch, main is the only option and is selected, but has this error message:

"Select a valid choice. main is not one of the available choices"

Doesn't seem to be any way to save the settings because I can't comply with the error instructions.

2 answers

2 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2024

Hi Ben and welcome to the community!

This is due to a bug that occurs with empty repositories (that have no commits). We have a bug report here:

The bug report concerns renaming, but the bug occurs when changing other details in the repository details of an empty repo as well.

If you add a commit to the repository, you should be able to change the settings and save successfully.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

0 votes
Kuğbe
Contributor
July 11, 2024

Hi @[deleted] 

Welcome to the community

Looking at you issue, this issue typically occurs when the main branch is not recognized correctly by the system due to some inconsistencies or misconfigurations.

To-DO:

Branch Protection Rules:

  • Go to the repository settings on Bitbucket.
  • Navigate to Branch permissions or Branch restrictions.
  • Ensure there are no rules that conflict with the main branch or try temporarily removing these rules and saving the settings.

Rename the Branch Temporarily:

  • Use the Git command line or SourceTree to rename the main branch to something else (e.g., main-temp), and then rename it back to main.
git branch -m main main-temp
git branch -m main-temp main

Update Remote Tracking Branch:

  • Make sure the remote tracking branch is set correctly:
git branch -u origin/main main

Note: Some Git clients have a cache that might need clearing.

If the above steps do not resolve the issue, consider reaching out to Bitbucket support for assistance, providing them with the exact error message and steps you have taken.

 

Good Luck
Kuğbe

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events