Deploy Hexo on github, hexogithub without a password

Source: Internet
Author: User

Deploy Hexo on github, hexogithub without a password

Hexo password-free deployment to github

When using the (hexo d) command to deploy hexo to github, you need to enter the user name and password every time. This will make it more complicated to preview your blog. The following method will free you from this pain.

First, set an environment variable in the system environment variable.

12
HOME%USERPROFILE%

For example:

Create a file named _ netrc under your user directory (C: \ Users \ username ).
Edit this file

123
machine github.comlogin usernamepassword password

After these settings, you do not need to enter the user name and password when deploying the service again.

Author: foreverpx
Link to the original article: Hexo deploy without entering a password on github


How to write articles on github

This article is successfully tested in Windows 7.

Install and set Git

Download Git
For Windows, use the default installation. After installation, you can use Git locally.

To put the content on Github, you must first register an account on the Github website, and then create an SSH Key using Git on the local machine. The procedure is as follows:

Run the following command on Git Bash:
Ssh-keygen-C "username@email.com"-t rsa

Note: The username@email.com needs to be replaced with the Email address or Username you registered on Github

This will generate a. ssh folder under the user directory (C: \ Users \ User Name), which contains the corresponding SSH
Keys, where id_rsa.pub is the SSH public key file required by Github.

Go to the c: \ Users \ User Name \. ssh \ directory and find id_rsa.pub (the location may not be correct, but make sure it is a file ending with. pub). Open and copy all the content in notepad.

Note: It is recommended that the name of the private key should be "id_rsa", so that this file will be found when you connect to Github. If the file name is set, you can rename the file later.

On the github website, choose "Account Settings"> "SSH Public Keys"> "Add another ".
Public key, paste the copied content into the key text box.

In this way, you can directly use Git and GitHub.

Note: It is recommended to enter "ssh-v git@github.com" in Git Bash to test normal connection to github

Install the Ruby Environment

Download RubyInstaller and DevKit.

.

Install RubyInstaller first, and decompress DevKit (the path cannot contain Chinese characters ).

In the "Start Command Prompt with Ruby" Command line, enter the DevKit decompression directory, and then run the following Command:
Ruby dk. rb init
Ruby dk. rb install
Gem install rdiscount -- platform = ruby

If the installation is successful, you can use some Ruby tools and provide a basic environment for building a blog later.

Install Octopress

First clone an Octopress file from Github through Git (enter the command on Git Bash)
Git clone git: // github.com/imathis/octopress.git octopress

Then install some dependent tools (entered in Start Command Prompt with Ruby later)

Cd octopress
Ruby -- version # shocould report Ruby 1.9.2
Gem install bundler
Bundle install

Install Octopress's default Theme

Rake install

Configure Octopress

Change the _ config. yml encoding in the octopress folder to the UTF-8:

Select the encoding format as UTF-8 when saving (or saving)

Modify _ config. yml to correct url, title, subtitle, autho ...... the remaining full text >>>

Hexo is dragged to github. How can I bind a 10 thousand network domain name?

Please pay special attention to applying for domain names and host space: services are the key. For such products, 80% depends on services .. You must first communicate for 2-5 hours, ask clearly, and then buy again. Some service providers cannot find people, or the after-sales phone cannot get through, which will be very troublesome.
 

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.