From dfd390e789a4f6dc77d74eed5d867c2876849149 Mon Sep 17 00:00:00 2001 From: ILdar Nogmanov Date: Tue, 26 May 2020 22:10:30 +0300 Subject: [PATCH 1/2] Close #24479 --- docs/docs/how-gatsby-works-with-github-pages.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/how-gatsby-works-with-github-pages.md b/docs/docs/how-gatsby-works-with-github-pages.md index e6dc627d52bd0..447dedc703f1f 100644 --- a/docs/docs/how-gatsby-works-with-github-pages.md +++ b/docs/docs/how-gatsby-works-with-github-pages.md @@ -61,6 +61,12 @@ When you run `npm run deploy` all contents of the `public` folder will be moved ### Deploying to a GitHub Pages subdomain at github.io For a repository named like `username.github.io`, you don't need to specify `pathPrefix` and your website needs to be pushed to the `master` branch. +>:warning: Keep in mind that Github Pages forces deployment of user\organization pages to master branch. So if you use master branch for development you need to do one of this: +>- change the default branch from master to something else, and use master just as site deployment directory: +> 1) to create new branch called `source` run this command: +>`git checkout -b source master` +> 2) change default branch in repository settings ("Branches" menu item) from master to source +>- have separate repository for your source code (so .github.io is used only for deployment and not really for tracking your source code) ```json:title=package.json { From 69824f23909c8c7adab6e6c6fff0354f58213a40 Mon Sep 17 00:00:00 2001 From: ILdar Nogmanov Date: Wed, 27 May 2020 08:32:16 +0300 Subject: [PATCH 2/2] chore: format --- docs/docs/how-gatsby-works-with-github-pages.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/docs/how-gatsby-works-with-github-pages.md b/docs/docs/how-gatsby-works-with-github-pages.md index 447dedc703f1f..90ccf90b2e0b8 100644 --- a/docs/docs/how-gatsby-works-with-github-pages.md +++ b/docs/docs/how-gatsby-works-with-github-pages.md @@ -61,12 +61,14 @@ When you run `npm run deploy` all contents of the `public` folder will be moved ### Deploying to a GitHub Pages subdomain at github.io For a repository named like `username.github.io`, you don't need to specify `pathPrefix` and your website needs to be pushed to the `master` branch. ->:warning: Keep in mind that Github Pages forces deployment of user\organization pages to master branch. So if you use master branch for development you need to do one of this: ->- change the default branch from master to something else, and use master just as site deployment directory: -> 1) to create new branch called `source` run this command: ->`git checkout -b source master` -> 2) change default branch in repository settings ("Branches" menu item) from master to source ->- have separate repository for your source code (so .github.io is used only for deployment and not really for tracking your source code) + +> :warning: Keep in mind that Github Pages forces deployment of user\organization pages to master branch. So if you use master branch for development you need to do one of this: +> +> - change the default branch from master to something else, and use master just as site deployment directory: +> 1. to create new branch called `source` run this command: +> `git checkout -b source master` +> 2. change default branch in repository settings ("Branches" menu item) from master to source +> - have separate repository for your source code (so .github.io is used only for deployment and not really for tracking your source code) ```json:title=package.json {