Use GitHub to deploy static Web pages?????? This tutorial is intended primarily for creating warehouses directly. Students who want to get started directly from GitHub can deploy static Web pages in the tutorials above.
What I want to share with you is how to deploy a project that has already created a warehouse and has a master branch as a static Web page.
Automatically generate pages
1. Click Settings
automatically generate pages
The warehouse name matches the access level two domain name.
Jump to this page, ignore directly, click the button at the back.
Randomly select, submit.
Now we have generated the Gh-pages branch.
Gh-pages Branch content.
* Local Push code to branch *
Go to destination Folder
View Branches
$ git branch
Only master one branch, because we just created the branch in the remote repository, now create the same name locally on the branch gh-pages
$ git branch gh-pages
We're still on the master branch, now switch branches.
$ git checkout gh-pages
Perfect switch, now commit the code to the local branch
To push code to a remote warehouse
$ git push origin gh-pages
Be sure to indicate the name of the PUSH branch!!!!
Obviously there is a conflict, pull back, pulling back also to indicate the name of the PUSH branch!!!!
$ git pull origin gh-pages
Resolve conflicts, resubmit, or add
Push again
Perfect!
Look at what's happening on GitHub.
Perfect! The static files that need to be demonstrated are on the Gh-pages branch. Now, come and visit me. Do you remember what the demo address is? Hee Hee
Look in the settings.
Go and see it! This is a mobile Web application, hehe my static website
Similarly, we can deploy our own static blog in this way. is much freer than the Coding,github.
Compared to the blog forum, their own design blog more FREE!!! Ah, recently too busy ... Empty I also daoteng a super-dazzle blog. (> 3 <)
Deploy static Web pages with GitHub