Deploy static Web pages with GitHub

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.