git branch: gh-pages

后端 未结 9 935
北荒
北荒 2020-12-07 10:43

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

9条回答
  •  无人及你
    2020-12-07 11:16

    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.

提交回复
热议问题