Skip to content

Instantly share code, notes, and snippets.

@saloev
Forked from tduarte/publish-ghpages.md
Created February 29, 2020 16:57
Show Gist options
  • Select an option

  • Save saloev/c3cc8c38c55b3012d10472177c9dcc61 to your computer and use it in GitHub Desktop.

Select an option

Save saloev/c3cc8c38c55b3012d10472177c9dcc61 to your computer and use it in GitHub Desktop.
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@saloev
Copy link
Author

saloev commented Feb 29, 2020

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

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