GitHub file upload and GitHub pages blog Building Tutorials

Source: Internet
Author: User
Tags install node using git

First, connect with GitHub

1. Install node. js and Git

2. Desktop New Folder "GitHub", right click "Git bash Here"

3. Register your GitHub account, create a new warehouse "new repository", tick "Initialize this repository with a README"

4. Generate a new SSH key, you need to enter the key when the direct carriage

Ssh-keygen " e-mail address @youremail.com "

5. Locate the newly generated SSH key in the "id_rsa.pub" file and copy and paste it to GitHub's "settings"-"Add Key"

6. Whether the test was successful

ssh -t [email protected]

The first time you connect, you need to enter "yes" to return

7. Set up account information

" your name. "  "[email protected]"
Second, upload files to GitHub

1. Create a warehouse on GitHub

2. Local Clone repository

git clone https://github.com/nwsci/wangyi.git

3. If you previously created the warehouse, tick "Initialize this repository with a README" and go directly to the fourth step; otherwise you need to create a readme.md

git init Touch  'first_commit'git Remote add origin https://github.com/ Findingsea/myrepoforblog.gitgit push Origin master

4.push file

' file name ' git remote add origin https: // github.com/nwsci/wangyi.gitgit push Origin master

Note: If an error "Fatal:remote origin already exists" is executed when the third command executes, first

RM Origin

The fourth command executes if the error "error:failed to push som refs to ..." is executed first.

Git pull Origin Master
Iii. Creating a blog using github pages

1. Create a new project on GitHub, named "Username.github.io"

2. Install Hexo using git

Install -G Hexo

3. Create a new "Hexo" folder locally and right click "Git bash Here"

$ HEXO Init

4. Execute the following command, then go to the browser to access "localhost:4000" to see

$ Hexo g$ Hexo S

Note: "Error try running: ' npm install Hexo--save '" is encountered when executing the command, follow the instructions to install the command, then retry the command

Install Hexo--save

5. Copy the theme

$ git clone https://github.com/a-limon/pacman.git Themes/pacman

Or

$ git clone https://github.com/cnfeat/cnfeat.git Themes/jacman

6. Enable Themes

Modify the Theme property in the "config.yml" configuration file under the "Hexo" directory to set it to Pacman. Also, set the Compress value in the Stylus property to True.

7. Update the theme

$ cd themes/jacman$ git pull

8. Local Environment construction

Reference step by step create a blog on GitHub home page (4)

9. Local View debugging

$ hexo G #生成 $ hexo S #启动本地服务 for article preview debugging

or use the combo command directly

$ Hexo D-g

More reference step-by-step create a blog on GitHub homepage-latest Version

GitHub file upload and GitHub pages blog Building Tutorials

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.