Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

Keep gh-pages in sync with master

Sharing is caring!

GitHub Pages is designed to host your personal, organization, or project pages directly from a GitHub repository.

Add changes to your master branch

echo "My Page" > index.html
git add .
git commit -m 'Lorem Ipsum'
git push origin master

Add changes to gh-pages

git checkout gh-pages // go to the gh-pages branch. Use 'git checkout -b gh-pages' if branch doesn't exist
git rebase master // bring gh-pages up to date with master
git push origin gh-pages // commit the changes
git checkout master // return to the master branch

Your page will be available at https://your-github-username.github.io/repository/.