Hexo主题备份问题

一般备份hexo目录是,发现主题并没有提交上去,如下图:
hexo主题备份问题
解决方式如下:

  1. git rm --cached themes/next/

     rm 'themes/next'
    
  2. git status

     On branch master
    
     Your branch is up to date with 'origin/master'.
    
     Changes to be committed:
       (use "git reset HEAD <file>..." to unstage)
    
         deleted:    themes/next
    
     Untracked files:
     (use "git add <file>..." to include in what will be committed)
    
     themes/
    
  3. git add themes/next/

  4. git status

     On branch master
     	Your branch is up to date with 'origin/master'.
     
     	Changes to be committed:
       	(use "git reset HEAD <file>..." to unstage)
     
             deleted:    themes/next
             new file:   themes/next/.all-contributorsrc
             new file:   themes/next/.editorconfig
             new file:   themes/next/.eslintrc.json
     		new file:   themes/next/.gitattributes`
     		......
    
  5. git commit -m “备份next主题”

     [master 2386fe5] 备份next主题
      347 files changed, 27937 insertions(+), 1 deletion(-)
      delete mode 160000 themes/next
      create mode 100644 themes/next/.all-contributorsrc
      create mode 100644 themes/next/.editorconfig
      ......
    
  6. git push origin master

     Enumerating objects: 418, done.
     Counting objects: 100% (418/418), done.
     Delta compression using up to 4 threads
     Compressing objects: 100% (400/400), done.
     Writing objects: 100% (416/416), 761.18 KiB | 3.49 MiB/s, done.
     Total 416 (delta 27), reused 0 (delta 0)
     remote: Resolving deltas: 100% (27/27), completed with 1 local object.
     To https://github.com/jiaoht/HexoDemoBac.git
        e495fcb..2386fe5  master -> master
    

----------------The end----------------------------

延伸问题

  • 如果使用自己的域名替换 username.github.io后,hexo再次生成部署后,会将dns服务商提供的CNAME删除掉,所以需要将它重新加到git项目中,还有一种简单的办法就是将CNAME加到hexo项目的source中,直接渲染到git项目中。

github page:https://jiaoht.github.io/2019/08/13/Hexo-%E4%B8%BB%E9%A2%98%E5%A4%87%E4%BB%BD%E9%97%AE%E9%A2%98/

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值