Hexo git configuration issue notes

Source: Internet
Author: User
Tags install node

Local Installation Hexo steps

Note: This tutorial is for Windows users only, and for Linux and Mac users, please go to hexo installation.

    • Install Git

      Download Msysgit and execute to complete the installation.

    • Install node. js

      Installing node. js in a Windows environment is easy, just download the installation files and execute them to complete the installation.

    • Installing Hexo

      Install with the NPM command. (Right click anywhere, choose Git bash)
      NPM install-g Hexo
      After the installation is complete, under your favorite folder (such as H:\hexo), execute the following instructions (right-click within H:\hexo and choose Git bash), Hexo will automatically create all the files needed for the site in the destination folder. Create a Hexo folder
      Hexo Init
      Install dependent packages
      Local view

Now that we have built the local Hexo blog, execute the following command (in H:\hexo), then go to the browser input localhost:4000 look.
Hexo Generate
Hexo Server
Well, at this point, the local blog has been built up, just local oh, others can not see. Below, we're going to deploy to GitHub.

Submit Hexo to GitHub step
    • Sign up for a GitHub account

      Already have an account can skip, no, please register here, very simple, here is not introduced.

    • Create repository

      In the bottom right corner of your GitHub home page, create a new repository. For example, my GitHub account is imsofter, so the repository name I should create should be imsofter.github.io.

    • Deployment

      Edit the _config.yml (under H:\hexo). When you deploy, replace the following zippera with your account name.
      Deploy
      Type:github
      Repository:https://github.com/imsofter/imsofter.github.io.git
      Branch:master
      Execute the following instructions to complete the deployment. It is said that in the latest version of Hexo, this type is written in Git, not GitHub.
      Hexo Generate
      Hexo Deploy
      Remember: Every time you modify a local file, you need Hexo generate to save it. Each time the command is used, it is in the H:\hexo directory. Note: Some new users need to set up SSH, otherwise the above command will fail. SSH Introduction and Setup method please see the official tutorial, do not worry, very simple.
      Okay, our blog has been completely built up, in the browser to visit Zippera.github.io can see your achievements!

Following is a summary of installation problems after installing Hexo, Bash:hexo:command not found

Locate C:\Users\Administrator\AppData\Roaming\npm\node_modules\hexo\bin\ and add this directory to the environment variable

Error Deployer not found:github occurred after executing hexo deploy

Hexo Update to 3.0, the deploy type of GitHub needs to be changed to Git
Repository path: Http://github.com/imsofter/imsofter.github.io.git (requires HTTPS to be modified to HTTP) not yet.
[Email protected]:imsofter/imsofter.github.io.git path
After you have changed, perform the NPM install hexo-deployer-git--save installation hexo for the GIT deployment tool.

And then try to deploy it again.

Verify error Error verification failed:

Error:host Key verification failed.
Fatal:could not read from remote repository.
Please make sure the correct access rights and the repository exists.

WORKAROUND: Conditional Sshkey
$ ssh-keygen-t rsa-c "[Email protected]"
Three times enter, you can set the password to empty

Add Id_rsa.pub from the generated C:\Users\Administrator.ssh directory to GitHub

Test if you can connect to GitHub,
$ SSH [email protected]
Hi imsofter! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

You can then push the code onto GitHub.

Bind domain Name

Create a CNAME file under the source directory
DNS settings
With Dnspod, fast, free, stable.
Register dnspod, add a domain name, such as settings.

Where A's two records point to the IP address that is provided by the GitHub pages IP
192.30.252.153
192.30.252.154

Hexo git configuration issue notes

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.