系统重装后快速恢复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 xxxxxx@xxxxx.xxx(上面自己的邮箱)
    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(公有密钥)

    用记事本打开
  • 在GitHub右上角用户找到Settings
  • 在左边找到SSH…
  • new一个ssh,把id_rsa.pub里面的东西全放进去,标题随便起。
  • 在git bash 下输入命令检测是否成功
    ssh -T git@github.com
    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地址

  • git remote add origin SSH地址,连接方式改为SSh
  • git remote -v 查看发现已更改
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值