Last active
November 18, 2023 15:30
-
-
Save kbychkov/91e6db409ea10068ffaa3e1d8ac264b8 to your computer and use it in GitHub Desktop.
Working with gh-pages as an orphan branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create `gh-pages` branch from scratch | |
cd <dir> | |
git init | |
git remote add origin <url> | |
git checkout --orphan gh-pages | |
git add . | |
git commit -m "build 1.0.0" | |
git push origin gh-pages | |
# Clone remote `gh-pages` branch | |
git clone -b gh-pages --single-branch <url> <dir> | |
# Update `gh-pages` branch from existing folder | |
cd <dir> | |
git init | |
git remote add origin <url> | |
git fetch origin gh-pages | |
git reset origin/gh-pages | |
git checkout gh-pages | |
git add . | |
git commit -m "build 1.x.x" | |
git push origin gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment