关于hexo+github pages创建博客

1.在使用git对源代码进行push到github时,出现了好几回这种状况:git

1 $ git push -u origin master 2 To github.com:wangmengjun142857/wangmengjun142857.github.io.git 3  ! [rejected]        master -> master (fetch first) 4 error: failed to push some refs to 'git@github.com:wangmengjun142857/wangmengjun142857.github.io.git'
5 hint: Updates were rejected because the remote contains work that you do
6 hint: not have locally. This is usually caused by another repository pushing 7 hint: to the same ref. You may want to first integrate the remote changes 8 hint: (e.g., 'git pull ...') before pushing again. 9 hint: See the 'Note about fast-forwards' in 'git push --help' for details.

  出现错误的主要缘由是github中的README.md文件不在本地代码目录中。使用以下命令便可进行代码合并:git pull --rebase origin master,执行上面代码后能够看到本地代码库中多了README.md文件,此时再执行语句 git push -u origin master便可完成代码上传到github。github

2. hexo安装没问题,但不能访问 localhost:4000,是由于电脑端口(4000)被(福昕阅读器)占用。使用以下命令行: hexo s -p 5000  将端口换成5000便可。hexo

3. hexo+github pages搭建的我的网站算是完成了,但问题仍是很大,下午换主题失败,我的网站该放一放了。忙完更重要的事再好好研究。fetch

相关文章
相关标签/搜索