Github pages - send updates to the right branch


#1

I followed instructions which suggested that your site has to live in the gh-pages branch. when doing a git push it seemed to be updating into the master though.

here are the commands i was doing:
git add .
git commit -m “myupdate”
git push


#2

GitHub no longer requires that your site live in the gh-pages branch… master branch will do fine as well…
Even still, if you wish to push commits to the gh-pages branch then simply use the following command:

git push origin gh-pages

where origin refers to the name of your remote handler.
To show a list of currently configured remote handlers, simply run the following:

git remote -v

#3

ok great thanks that worked. If I understand this correctly, every time I want to publish a new post, I have to run the git add, commit and push cycle to update the site?


#4

yes if you are doing it locally.

You could also do it on the GH site itself. Then you have to remember to git pull the next time you do it locally to pull down the changes you don’t have.


#5

ok great, thanks for the help :+1: