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!


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

This thread is a bit old already, but seemed like the best place for my comment:

  • I created a new repository.
  • I go to the site and get “404 There isn’t a GitHub Pages site here.”
  • I waited a bit, updated the repo, but nothing changed.
  • I finally realized that in “ -> Settings -> Options -> GitHub Pages” under “Source” it said: “Your GitHub Pages site is currently being built from the master branch.”
  • As the default for new repositories is now “main”, GitHub Pages didn’t find a “master” branch and gives the 404 error.
  • Once I changed the source to “main” the site was available.

It would be nice if GitHub Pages also used “main” as the default to match the new repository default.


Hello Thomasshaped

I am the Program manager in https// team and we have hundreds of repo with “master” as the default branch and we are waiting to know when GitHub will provide the tool to help with renaming the master to main as mentioned at

1 Like

Hello, in reading the renaming guidance you linked, I am under the impression that main has all the functionality of ‘master’. However, I am unable to push to main and can only push to a master folder that I create. When I push to main, I get the error: src refspec main does not match any
error: failed to push some refs to ‘BLAH · GitHub blah blah.git’. Is this expected behavior? I am watching a bunch of tutorials where people easily push to the old main/master. Why is this functionality no longer available?