扫码关注官方订阅号
我想应该不需要先在 master 分支 build 然后复制 dist 文件夹到 gh-pages 分支再提交吧各位大佬是如何管理 gh-pages 分支呢?
master
build
dist
gh-pages
npm intall gh-pages
gh-pages已经升级了,貌似不再需要单独的分支了。
我以前的话,是单独给这个东西写个命令。差不多长这样:
const promises = [task1, task2, task3, task4].map((n) => new Promise(n)); Promise.all(promises) .then(git('init')) .then(git('add', '-A')) .then(git('commit', '-m', 'update')) .then(git('push', '-u', url, 'master:' + branch, '--force')) .then(() => console.log('\n INFO: 文件上传完毕。')) .catch((err) => console.log('\n INFO: 发生错误,意外中止\n' + err));
其中git函数是使用require('child_process').spawn封装的子进程。
git
require('child_process').spawn
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
npm intall gh-pages
gh-pages已经升级了,貌似不再需要单独的分支了。
我以前的话,是单独给这个东西写个命令。
差不多长这样:
其中
git函数是使用require('child_process').spawn封装的子进程。