Skip to content

Instantly share code, notes, and snippets.

@csesumonpro
Last active April 7, 2021 15:04
Show Gist options
  • Save csesumonpro/9036eb4132bad9793419c8edddb903ab to your computer and use it in GitHub Desktop.
Save csesumonpro/9036eb4132bad9793419c8edddb903ab to your computer and use it in GitHub Desktop.
How to publish a project by github Pages command below

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

Step 2

Make sure git knows about your subtree (the subfolder with your site).

git add dist && git commit -m "Initial dist subtree commit"

Step 3

Use subtree push to send it to the gh-pages branch on GitHub.

git subtree push --prefix dist origin gh-pages

Step 4

Use below command for update it again

git push origin `git subtree split --prefix dist master`:gh-pages --force

**Note If your folder isn’t called dist, then you’ll need to change that in each of the commands above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment