github搭建博客

#下载
下载git的官网地址
我下载的最新版是:Git-1.9.5-preview20150319.exe
不区分windows的版本,我的电脑是xp,也可以安装,全部用默认值即可。

#打开
在 开始-所有程序 里打开Git Bash。

注意,用cmd运行git命令会报错:

'git' 不是内部或外部命令,也不是可运行的程序或批处理文件。

解决办法:Windows下配置Git

#命令

git init

运行后所在目录会多了一个隐藏文件夹.git。

git checkout --orphan gh-pages

运行后,.git里的HEAD文件会写入。

git add .
git commit -m "first post"

运行后,在https://github.com/ouyida3里点击Repositories,然后点击NEW,然后创建一个名为jekyll_demo库。
否则会报错:remote: Repository not found.
fatal: repository ‘https://github.com/ouyida3/jekyll_demo.git/’ not found

git remote add origin https://github.com/ouyida3/jekyll_demo.git
git push origin gh-pages

push是需要输入用户名密码的。

如果修改了某文件,则需要:

git add _posts/2015-04-08-hello-world.html
git commit -m "update"
git push origin gh-pages

不add的话会报错:changes not staged for commit
如果不add和commit就push,会提示:Everything up-to-date
注意,如果git commit没有-m,会提示,:q退出重来即可。

构建失败会push后立即发一封邮件到你邮件:

The page build failed with the following error:
The file index.html is not properly UTF-8 encoded. For more information, see https://help.github.com/articles/page-build-failed-file-is-not-properly-utf8-encoded.

#参考资料

ouyida3的csdn博客
2015.4.8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值