To push the contents of your dist
folder to gh-pages, use the following steps:
- Make sure your branch to deploy gh-pages from is deleted on the remote. We'll be using the "pages" branch as an example.
git checkout -b pages
to create and checkout the new branch- Edit your
.gitignore
to remove the ignore fordist
git add -A
to add all changesgit commit
your changesgit subtree push --prefix dist origin pages
- this will push the contents ofdist
to thepages
branch, so that it only contains the contents ofdist
and nothing else from the repository/parent folders. This means thatindex.html
will be at the root of the branch and you can select it to deploy immediately in your repo's options.