


























If you're familiar with command-line Git, it's straightforward to manually create a Github Pages site.
To set up a Project Github Pages site, you need to create a new "orphan" branch (a branch that has no common history with an existing branch) in your repository. The safest way to do this is to start with a fresh clone:
$ git clone github.com/user/repository.git# Clone our repositoryCloning into 'repository'...remote: Counting objects: 2791, done.remote: Compressing objects: 100% (1225/1225), done.remote: Total 2791 (delta 1722), reused 2513 (delta 1493)Receiving objects: 100% (2791/2791), 3.77 MiB | 969 KiB/s, done.Resolving deltas: 100% (1722/1722), done.Switch directories into your new cloned repository:
$ cd repositoryCheck if your repository already has a gh-pages branch:
$ git branch# shows a list of branches for your repository* branch-name* branch-nameIf you don't already have a gh-pages branch in your repository, create a new gh-pages branch:
$ git checkout --orphan gh-pages# Creates a `gh-pages` branch, without any parents (it's an orphan!)Switched to a new branch 'gh-pages'$ git rm -rf .# Remove all files from the old working treerm '.gitignore'$ echo "My Page" > index.html$ git add index.html$ git commit -a -m "First pages commit"$ git push origin gh-pagesAfter your push to the gh-pages branch, your Project Pages site will be available at 'http(s)://[username].github.io/[projectname]' . Note that Pages are always publicly accessible when published, even if their repository is private.
https://help.github.com/articles/creating-project-pages-from-the-command-line/
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。