GitHub from uploading code to publishing a static website

Source: Internet
Author: User

1. Uploading Code

First step: Build a git repository
CD to your local project root directory, execute the git command

Git init

Step Two: Add all the files of the project to the warehouse

git Add.

If you want to add a specific file, simply change it to a specific filename.

Step three: Commit the Add file to the repository

git commit-m "comment statement"

Fourth step: To create your own repository on GitHub, create the page as shown:

Click on the Create repository below, you will go to a page similar to the one below, get the HTTPS address of the warehouse created, the red box is marked

Fifth step: Focus on the local warehouse to GitHub

git remote add origin https://github.com/xiarainday/test

the following HTTPS link address is replaced by your own warehouse URL address, which is the red box above the winning address

Sixth step: Before uploading GitHub, pull it first and execute the following command:

  git pull origin master

Seventh step, the last step, upload the code to GitHub remote repository

git push -u origin master

after execution, if there is no exception, wait for the completion of the upload succeeds, the middle may let you enter username and password, you just enter GitHub's account number and password on the line.

I finally uploaded the code after the success. Oneself in the second step to the first try a few times, during a variety of no find, existed, and so on, and finally myself directly to try the last one, so upload success, some places still not quite understand only this.

Reference: http://blog.csdn.net/hanhailong726188/article/details/46738929

2. Publish a static web page

After the successful code upload can be published static web page, careful child shoes should have seen I upload the code in the root directory there is an HTML file (release other cases have not tried, interested to try), when the release of the warehouse is automatically identified.

First Step: Click Setting

Step Two: Set up

Warehouse name and access level two domain name consistent

Scroll the mouse and you'll see the GitHub pages bar below

The entire release has also been completed.

After the setup is finished, go back to the code interface, which will have one more configuration file.

Published reference to http://blog.csdn.net/w1019945543/article/details/51955758, but do not know whether because of giuhub revision, there are always something different.

3. Attach最常用的 git 命令有:(来自http://www.cnblogs.com/len0031/p/5831571.html)

    add        添加文件内容至索引     bisect     通过二分查找定位引入 bug 的变更     branch     列出、创建或删除分支     checkout   检出一个分支或路径到工作区     clone      克隆一个版本库到一个新目录     commit     记录变更到版本库     diff  显示提交之间、提交和工作区之间等的差异     fetch      从另外一个版本库下载对象和引用     grep  输出和模式匹配的行     init       创建一个空的 Git 版本库或重新初始化一个已存在的版本库     log        显示提交日志     merge      合并两个或更多开发历史     mv  移动或重命名一个文件、目录或符号链接     pull       获取并合并另外的版本库或一个本地分支     push       更新远程引用和相关的对象     rebase     本地提交转移至更新后的上游分支中     reset      重置当前HEAD到指定状态     rm  从工作区和索引中删除文件     show       显示各种类型的对象     status     显示工作区状态     tag        创建、列出、删除或校验一个GPG签名的 tag 对象

GitHub from uploading code to publishing a static website

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.