换了新电脑,怎么更新自己以前部署在GitHub上的hexo博客呢?
- 在自己目录A内拷贝之前的仓库(当然,可以不用全拷贝,比如node_modules/,public/,.deploy_git/这些是没用的),或者在此目录内下载自己的仓库。
- 安装环境:Git和Node.js
2.1 配置Git
2.2 安装完Git之后,在A内右键,选择Git GUI here.
2.3 help - show SSH KEY, 创建一个ssh key, 并拷贝。
2.4 网页登录Github, 在设置中选择SSH and GPG keys,添加新的SSH key,把刚才复制的key 拷贝进去。
2.5 进入文件夹A,右键,Git Bash here, 设置自己的用户名和邮箱,最好和github相同:
$ git config --global user.name “your_username” #设置用户名
$ git config --global user.email “your_registered_github_Email” #设置邮箱
2.6 测试 ssh key:
$ ssh -T [email protected]
系统会提示:
The authenticity of host 'github.com'