I have a repo on GitHub. Recently I have discovered GitHub\'s pages and I want to use them.
I would like to create this new branch and then, when I need to, either commi
The typical way is to switch branches: git checkout master if you want to work on master and git checkout gh-pages if you want to work on gh-pages.
Starting with git 2.5, you can have both branches checked out at the same time (in different directories). See https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows. Setup via git worktree add -b gh-pages ../gh-pages origin/gh-pages.
Bonus: If the content of a subdirectory of your master checkout is the content of gh-pages, use the script provided at https://github.com/X1011/git-directory-deploy.