系统重装后快速恢复hexo

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

软件安装

Git和Node.js

配置git个人信息,生成新的ssh密匙

  • git config —global user.name “xxxxxx”
  • git config —global user.email “xxxxxx”
  • ssh-keygen -t rsa -C “xxxxxxxx(邮箱)”
    中间连按3个回车
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    Generating public/private rsa key pair.
    Enter file in which to save the key (/c/Users/Mr.Yang/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.
    Your public key has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:zA6wNJrFB6NcqS6eBog/AHlzQuvFjYpG759Yhh1lWGI [email protected](上面自己的邮箱)
    The key's randomart image is:
    +---[RSA 2048]----+
    | +E . |
    | ..+oo+ |
    | oo+*+.o |
    |o.*===+o |
    |==+*... S |
    |B.+.o .o |
    |++o. + . |
    | +o.+ . |
    |. o.o |
    +----[SHA256]-----+

在GitHub上建一个新的ssh

  • 在用户->.ssh目录下已经得到了两个文件:id_rsa(私有秘钥)和id_rsa.pub(公有密钥)
    系统重装后快速恢复hexo_第1张图片
    用记事本打开
  • 在GitHub右上角用户找到Settings
    系统重装后快速恢复hexo_第2张图片
  • 在左边找到SSH…
    系统重装后快速恢复hexo_第3张图片
  • new一个ssh,把id_rsa.pub里面的东西全放进去,标题随便起。
    系统重装后快速恢复hexo_第4张图片
  • 在git bash 下输入命令检测是否成功
    ssh -T [email protected]
    1
    2
    3
    4
    The authenticity of host 'github.com (207.97.227.239)' can't be established.
    RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    Are you sure you want to continue connecting (yes/no)? # 直接输入yes
    Hi cnfeat! You've successfully authenticated, but GitHub does not provide shell access

安装hexo

  • npm install hexo-cli -g
  • 检测是否完成 hexo server
  • 部署hexo g && hexo d

解决每次部署都要输入账户密码的问题

  • git remote -v查看远程连接方式
  • git remote rm origin删除之前的连接方式
  • GitHub仓库复制SSH地址
    系统重装后快速恢复hexo_第5张图片
  • git remote add origin SSH地址,连接方式改为SSh
  • git remote -v 查看发现已更改

你可能感兴趣的:(系统重装后快速恢复hexo)