Reputation: 68353
Are github pages within my account created automatically when I fork a repo which already includes gh-pages branch?
Upvotes: 41
Views: 11549
Reputation: 1
You would have to publish it afresh from your forked repo directory Run:
git push origin main
Upvotes: 0
Reputation: 126445
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:
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.
Upvotes: 5
Reputation: 383728
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.
Upvotes: 23
Reputation: 22670
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.
Upvotes: 0
Reputation: 516
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.
Upvotes: 5
Reputation: 68353
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.
Upvotes: 49