GitHub repos that also have a Pages branch are getting more commonplace, and maintaining these branches can a pain in the ass.
This is a simple method of adding multiple branches to one working directory. While I am only discussing adding
gh-pages branches, the idea can be used for any branch.
Intended directory structure
First, create a main directory, then add the
master branch locally.
repo-name should be the name of your repository.
Now we add the
gh-pages branch locally.
Please note: running
git clone email@example.com:username/repo.git XXX will create a directory named XXX. Alternatively, you can
mkdir a directory,
cd into it and use a period
. to use the current dir.