Publishing with Pages: moving master to main #23147
-
Hi all, We love GitHub Pages and have begun moving our master branch to main as recommended below: When will we be able to publish from “main” branch instead of “master” in GitHub Pages? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
-
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! |
Beta Was this translation helpful? Give feedback.
-
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? Thanks. |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
Wanted to drop an update in this thread that our repository tracking branch renaming has gone public: GitHubgithub/renamingGuidance for changing the default branch name for GitHub repositories - github/renaming There’s no change for the status of Pages right now—you’ll need to keep using either |
Beta Was this translation helpful? Give feedback.
-
Thanks for keeping on top of this, @thomasshaped. 😄 |
Beta Was this translation helpful? Give feedback.
-
This thread is a bit old already, but seemed like the best place for my comment:
It would be nice if GitHub Pages also used “main” as the default to match the new repository default. |
Beta Was this translation helpful? Give feedback.
-
Hello Thomasshaped I am the Program manager in https//docs.microsoft.com 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 https://github.com/github/renaming#later-this-year-seamless-move-for-existing-repositories- |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
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.