-
安装好Git之后需要配置本机与Github之间的ssh方便更新同步博客到Github上,在一个地方新建一个文件夹作为我们博客的根目录,在文件夹内右键选择Git bash here
git config --global user.name "你的GitHub注册名"
# 回车
git config --global user.email "你的Github注册邮箱"
# 回车
ssh-keygen -t rsa -C "你的GitHub注册邮箱"
# 三个回车,保持默认就行,如果成功会出现一堆字符一样的画面
并且会在C:\Users\你的用户名.ssh\下生成id_rsa.pub这个文件,用记事本打开复制其中的内容到Github网站设置页面中的SSH and GPG keys标签,点击右上角的New SSH Key添加一个新key,


然后在bash中运行
ssh git@github.com
如果提示如下那么说明SSH Key配置正确

- 用以下npm命令安装hexo相关包到你的电脑上
npm install -g hexo-cli
- 初始化hexo博客系统
hexo init

- 生成静态文件
hexo g

- 本地运行博客系统
hexo s

- 用浏览器访问http:localhost:4000即可成功打开本地的博客页面
网友评论