本文最后更新于1 个月前,文中所描述的信息可能已发生改变。
备份整个blog文件夹(除 node_modules 文件夹以及一些临时文件)
在新设备上安装 node.js 、npm、git
使用npm全局安装hexo
在博客文件夹下执行
npm install
安装依赖配置ssh密钥
ssh-keygen -t rsa -C "[email protected]"
生成密钥后复制内容粘贴到代码托管网站的个人密钥设置中 github>settings>SSH and GPG keys>New SSH key设置git全局身份
git config --global user.name "your user name"
git config --global user.email "[email protected]"
定位到备份下来的blog文件夹,执行hexo d部署尝试,可能会遇到以下错误提示:
“Warning: Permanently added the RSA host key for IP address 'i.p.i.p' to the list of known hosts.”
并会询问是否仍要建立连接(yes/no) yes 就可以了