Are Github pages created automatically in the fork of a repo which has a gh-pages branch?

邮差的信 提交于 2019-12-03 08:58:21

问题


Are github pages within my account created automatically when I fork a repo which already includes gh-pages branch?


回答1:


There needs to be at least one push to trigger a page build so by doing a git push origin master, I got the page to rebuild.




回答2:


An elegant approach:

git push -f origin gh-pages^:gh-pages
git push origin gh-pages:gh-pages

git push origin master might not be good because if there might already be something on master. The above should always work, as it just wobbles the remote branch back and forward.

Taken from: Pushing without committing , whose solutions are also solutions to this question.




回答3:


Forking a repository within Github is not sufficient by itself to trigger the creation of the Github Pages.

Either of these two things will work:

  1. Edit and save any page using the Github interface. For example, modify the README.md file, even just adding a space.
  2. Make any kind of git push to the gh-pages branch. As others have suggested, a trivial non-change you can make is:

    git push -f origin origin/gh-pages^:gh-pages
    git push origin origin/gh-pages:gh-pages
    

This force-pushes the penultimate commit to be the gh-pages HEAD, then fixes it.




回答4:


After you fork a github page repo, you can change any file on github page and commit it, your web site will appear without using git.




回答5:


Renaming the forked repository would work too.




回答6:


No, after you fork a repo, you have to publish it again. To do this, run the following commands on a local clone:

git push -f origin origin/gh-pages^:gh-pages
git push origin origin/gh-pages:gh-pages

This triggers the publisher hook twice, but you don't have to commit anything.



来源:https://stackoverflow.com/questions/8587321/are-github-pages-created-automatically-in-the-fork-of-a-repo-which-has-a-gh-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!