This is a very short tutorial to know how to update files on gh-pages branch of github. Github provides an very easy interface to create repository and host your static HMTL files to its own server. However if you make a push to your repository branch you have to push it on gh-pages branch individually. Take a look at below steps how you are going to proceed from origin branch to gh-pages branch.
git add -A // Add all files except those mention under .gitignore git status // to know the new changes if available git commit -m 'Some descriptive commit message' //comitting your changes. git push origin master //push it into your master branch.
How to update files on gh-pages branch
Now take a look at how to update files on gh-pages branch.
git checkout gh-pages // go to gh-pages branch 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
If checkout to gh-pages doesn’t work please make a pull request from gh-pages.
git pull gh-pages
This will update your localhost will OUTDATED version. Now again make a pull request from master branch.
git pull origin master
Now try with the checkout code it should work.
git checkout gh-pages