No apparent way to rename the default branch of a project from Master to something more inclusive

Bug #1959968 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

I've been searching for a while today trying to find some sort of howto for changing the default branch from Master to something like Main for an LP project. Everythign I've found seems to work up to removing the old Master branch.

I took one of my projects, renamed Master to Main locally, changed all the tracking and such and pushed to LP. I now have a Main branch on my LP project, and my local clones track Main instead of the old Master.

However, when I then try to delete the Master branch, I get an error telling me I don't have permission to delete the unused Master branch in my own project.

 ! [remote rejected] master (deletion of the current branch prohibited)

Looking a bit further at this: https://www.git-tower.com/learn/git/faq/git-rename-master-to-main

and I've learned that GitHub makes this pretty easy, but simply renaming Master to anything arbitrary you wish, and then including instructions on how to update the local repos to match.

Launchpad Git should include an easy way to change the default branch of a project.

Revision history for this message
Jürgen Gmach (jugmac00) wrote (last edit ):

You need to set the new default branch in the Launchpad UI.

- go to your repository
- at the right side click on "Change repository details"
- rename e.g. refs/heads/master to refs/heads/main

Please make sure that open merge proposals get merged first, or you will need to resubmit them.

I agree that there should be a proper help document for this.

Jürgen Gmach (jugmac00)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Jeff Lane  (bladernr) wrote :

AHHHHH!!! Thanks! that was the clue I needed.

I only saw "Configure Code" and thought THAT was the repository, but after your comment I had another look and realized I needed to go a bit deeper, and there I found the place to rename the refs.

Now it's all handled. And yeah, some documentation on this would be fantastic, especially given the drive to use more inclusive naming across projects.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.