Publishing with Pages: moving master to main

Hi all,

We love GitHub Pages and have begun moving our master branch to main as recommended below:

  1. Easily rename your Git default branch from master to main

When will we be able to publish from “main” branch instead of “master” in GitHub Pages?

Thank you!

We don’t currently have anything to announce on precisely when the transition from master to main will be happening. In the case of GitHub Pages it’s specifically coded that you need to deploy your site on the master branch. This will be changing when we do make these changes to the default branches but we don’t have an exact date yet. I’d recommend keeping an eye on the GitHub Blog for more news on when this will go live.

For now though you’ll still need to deploy your Pages site from the master or gh-pages branch, depending on the type of Pages site you’re publishing.

Will do - thanks, @thomasshaped.

A possible option would be for GitHub Pages publish to the default branch. Selecting either gh-pages or the default branch would work for older sites using “master”, as well as new sites where the default is “main” (or any other option).

Looking forward to the changes!

Hello @thomasshaped,

Thanks for the initial response on this. It’s reassuring to hear that change is afoot.

Do you know if there’s been any progress on this?
I can’t find any mention on the blog.


@QuintinWillison Not quite yet, though work is progressing! There’s unfortunately a lot of legacy assumptions that need to be catered for when making a change like this so the work is a little more complicated than just changing some references to master in the original code. I can’t give you an exact date on when these changes will be coming but they are on track to happen very soon!


Wanted to drop an update in this thread that our repository tracking branch renaming has gone public:

There’s no change for the status of Pages right now—you’ll need to keep using either master or gh-pages for the time being—but future updates will be posted in here and likely on the blog too. From the README it looks like we’re targeting later this year for the rollout of changes to Pages sites. I’d recommend you keep an eye on this repository for updates on this!

1 Like

Thanks for keeping on top of this, @thomasshaped. :smile: