同时部署到gitee和github, 编写npm脚本向两个仓库进行blog的备份
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| PS E:\Code\Blog\hexo-blog> git remote add github-origin https://github.com/roudoukou/hexo-blog.git PS E:\Code\Blog\hexo-blog> git remote add gitee-origin https://gitee.com/xialonggui/hexo-blog.git
PS E:\Code\Blog\hexo-blog> git remote show gitee-origin github-origin
PS E:\Code\Blog\hexo-blog> git remote -v gitee-origin https://gitee.com/xialonggui/hexo-blog.git (fetch) gitee-origin https://gitee.com/xialonggui/hexo-blog.git (push) github-origin https://github.com/roudoukou/hexo-blog.git (fetch) github-origin https://github.com/roudoukou/hexo-blog.git (push)
git add .
git commit -m \"github and gitee backup\"
git push gitee-origin master
git push github-origin master
|
最后编写npm脚本
1 2 3
| "scripts": { "ddd": "git add . && git commit -m \"github and gitee backup\" && git push gitee-origin master && git push github-origin master && hexo clean && hexo generate && hexo deploy" },
|
执行脚本
1
| PS E:\Code\Blog\hexo-blog> npm run ddd
|