git branch: gh-pages

后端 未结 9 917
北荒
北荒 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:39

    More recent versions of git have an alternative to the git symbolic-ref method that Chandru explained. This avoids having to use the lower level commands.

    git checkout --orphan gh-pages
    git rm -rf .
    
    0 讨论(0)
  • 2020-12-07 11:41

    I use this

    git push origin `git subtree split --prefix build`:$DEPLOY --force
    

    You can see working version https://github.com/rofrol/closeyoureyesnow/blob/master/build_and_deploy.sh

    0 讨论(0)
  • 2020-12-07 11:43

    You might find this tutorial useful:

    Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

    To me this approach seems simpler then doing a git checkout gh-pages each time you want to edit your gh-pages content. Let me know what you think ^_^

    Edit: I updated the tutorial link - thanks @Cawas. The old tutorial (not recommended) was https://gist.github.com/825950

    0 讨论(0)
提交回复
热议问题