备份
需要在github创建一个仓库,然后clone该仓库
git clone https://github.com/vliamzh/blogbackup.git
将之前博客目录全部复制到该文件夹下(除了.git/),以后都在该目录下工作
需要备份的时候直接运行以下命令
git add . && git commit -m "update" && git push -f
2024/08/01更新:上述方式弃用,直接用下面的方法:
- 博客根目录,执行
git init
创建 git 仓库。 - 在 github(或其他托管平台、自建远程仓库等) 创建仓库并和本地仓库建立联系。
- 在
~/.bashrc
文件中添加(windows可以用git bash操作)
alias hs='hexo clean && hexo g && hexo s'
alias hd='hexo clean && hexo g && hexo d && git add . && git commit -m "update" && git push -f'
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。