当我分叉一个已经包含 gh-pages 分支的仓库时,我的帐户中的 github 页面是否会自动创建?
6 回答
至少需要一次推动才能触发页面构建,因此通过执行 a git push origin master
,我得到了要重建的页面。
一种优雅的方法:
git push -f origin gh-pages^:gh-pages
git push origin gh-pages:gh-pages
git push origin master
可能不好,因为如果master
. 以上应该始终有效,因为它只是前后摇晃远程分支。
取自:Pushing without committing,其解决方案也是这个问题的解决方案。
在 Github 中分叉存储库本身不足以触发 Github 页面的创建。
这两件事中的任何一个都可以工作:
- 使用 Github 界面编辑和保存任何页面。例如,修改 README.md 文件,甚至只是添加一个空格。
git push
对gh-pages
分支进行任何类型的操作。正如其他人所建议的那样,您可以做的一个微不足道的非改变是:git push -f origin origin/gh-pages^:gh-pages git push origin origin/gh-pages:gh-pages
这迫使倒数第二个提交成为gh-pages
HEAD,然后修复它。
在你 fork 一个 github 页面 repo 后,你可以更改 github 页面上的任何文件并提交它,你的网站将出现而不使用 git。
重命名分叉的存储库也可以。
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.