I have a git repository (at github.com) with two branches: master and gh-pages. I would like to have the gh-pages branch in a subdirectory, so that I don\'t need to switch branc
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
.
If you want to have the content of a subdirectory of your master
checkout to be put into gh-pages
on github, use the script provided at https://github.com/X1011/git-directory-deploy.