I've just cloned a repo I have hosted on Github but this only checked out the master
branch. There's also a gh-pages
branch that Github creates automatically to host the project's site.
I want to also clone (checkout? pull?) this branch to work on it and I've found a lot of material on this that got me a bit confused.
This answer says that I should do:
git checkout -b gh-pages origin/gh-pages
and this one implies the command could be:
git branch -f gh-pages upstream/gh-pages
What is the difference between these two? Should I stick with the first one?
Add. If I do git branch -a
I get:
remotes/origin/HEAD -> origin/master
remotes/origin/gh-pages
remotes/origin/master