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