码迷,mamicode.com
首页 > 其他好文 > 详细

github hexo配置踩过的坑

时间:2016-05-03 23:34:39      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

大体步骤:配置npm,在github中增加自己的sshkey。

多sshkey的话在用户主目录的.ssh中要配置好。

删除仓库里面 source/_posts/我的文章.md

执行下面命令更新博客

hexo g == hexo generate#生成
hexo s == hexo server #启动服务预览
hexo d == hexo deploy#部署

生成ssh方法,多个shh

1.生成指定名字的密钥

ssh-keygen -t rsa -C "邮箱地址" -f ~/.ssh/github_jslite

会生成 github_jslitegithub_jslite.pub 这两个文件

2.密钥复制到托管平台上

vim ~/.ssh/github_jslite.pub

打开公钥文件 github_jslite.pub ,并把内容复制至代码托管平台上

3.修改config文件

vim ~/.ssh/config #修改config文件,如果没有创建 config

Host jslite.github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_jslite

Host abc.github.com
HostName github.com
User git
IdentityFile ~/.ssh/github_abc

添加到博客的config文件中

git remote add origin git@jslite.github.com:JSLite/JSLite.git

4.测试

ssh -T git@jslite.github.com # @后面跟上定义的Host

github hexo配置踩过的坑

标签:

原文地址:http://www.cnblogs.com/debugzer0/p/5456674.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!