Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

adjust wiki branch

Jason April 11, 2023

I created a wiki in my repository and see branch is set to master.  I want to adjust branch naming. I have no branch restrictions set in repository or workspace.

 

[main]> git push origin :master
remote: error: refusing to delete the current branch: refs/heads/master
To bitbucket.org:myrepo/myrepo.git/wiki
! [remote rejected] master (deletion of the current branch prohibited)
error: failed to push some refs to 'bitbucket.org:myrepo/myrepo.git/wiki'


Is there a way to adjust it?

 

Thanks!

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 13, 2023

Hello @Jason ,

Welcome to Atlassian Community!

I'm afraid that the wiki's master branch can't be deleted because this is the branch that is loaded when you open the repository's Wiki page in the UI. You have the option to create additional branches in your local clone of the wiki by using the following command :

git branch <new branch name>

and then pushing it to Bitbucket. However, the Bitbucket UI will only load the contents of the master branch. To have access to the content of other branches you have created in the wiki, you will have to clone it locally and check out to the desired branch : 

git checkout <branch name> 

Hope that helps! Let me know in case you have any questions.

Thank you, @Jason !

Patrik S 

Jason April 15, 2023

That does help, and thank you! In spirit of inclusivity, and following industry changes, I would encourage BitBucket to have default branch created with a different naming convention.

This change was noted awhile ago, but I don't know if wiki was part of change.

https://bitbucket.org/blog/moving-away-from-master-as-the-default-name-for-branches-in-git

Thanks @Patrik S 

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2023

Hello @Jason ,

Thank you for reporting this. That's definitely a valid suggestion.

I went ahead and create a feature request to also change the default branch name on Bitbucket Wiki from "master" to "main", so it aligns with the change made to the repository. You can access the feature request using the following link : 

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Thank you, @Jason !

Patrik S

Like Jason likes this
Jason April 18, 2023

Thanks, again!  I've updated it and am watching.

Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events