coneycode / hexo-git-backup Goto Github PK
View Code? Open in Web Editor NEWyou can use it to backup your blog into git.
License: MIT License
you can use it to backup your blog into git.
License: MIT License
原错误信息
hexo b
INFO Start backup: git
[source 7f8b55b] Backup blog
1 file changed, 1 insertion(+)
create mode 100644 ttt/ttt.txt
Branch 'master' set up to track remote branch 'source' from 'origin'.
Everything up-to-date
本身没从事前端开发,根据其中的一个issues,找到了git.js内的执行命令,添加
console.log(command,args);
通过打印命令
hexo b
INFO Start backup: git
git [ 'add', '-A' ]
git [ 'commit', '-m', 'Backup blog' ]
[source ee0a586] Backup blog
1 file changed, 1 insertion(+), 1 deletion(-)
git [ 'push', '-u', 'origin', 'master:source', '--force' ]
Branch 'master' set up to track remote branch 'source' from 'origin'.
Everything up-to-date
INFO Backup done: git
发现 push -u origin 后面 master:source 拼接有点不对劲
更改此处
for (var t in repo){
commands.push(['push', '-u', t, repo[t].branch, '--force']);
//commands.push(['push', '-u', t, 'master:' + repo[t].branch, '--force']);
}
成功提交。
1.ssh -T [email protected]:
Hi gdky005! You've successfully authenticated, but GitHub does not provide shell access.
2._config.yml
backup:
type: git
repository:
github: [email protected]:XXX.git,backup
3.分支 确定存在
3.hexo -b :
INFO Start backup: git
On branch backup
Your branch is up-to-date with 'origin/backup'.
nothing to commit, working directory clean
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
我同时备份博客到github和coding,执行hexo b
, 可以备份到coding,但是不能备份到github
手动备份没有问题
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
在博客根目录新建了 .gitignore,想排除掉 node_modules,可是好像没有效果呢
执行 hexo b 之后
TypeError: Cannot read property 'backup' of undefined
at Hexo.module.exports (/var/www/hx/node_modules/hexo-git-backup/backup.js:8:27)
at Hexo.tryCatcher (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Hexo.ret (eval at (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promisify.js:154:12), :12:39)
at /var/www/hx/node_modules/hexo/lib/hexo/index.js:192:9
at tryCatcher (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._resolveFromResolver (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promise.js:427:31)
at new Promise (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promise.js:53:37)
at Hexo.call (/var/www/hx/node_modules/hexo/lib/hexo/index.js:188:10)
at runHexoCommand (/usr/lib/node_modules/hexo/node_modules/hexo-cli/lib/index.js:58:17)
at tryCatcher (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/async.js:177:16)
at Async._drainQueues (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/async.js:187:10)
at Async.drainQueues (/var/www/hx/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
INFO Validating config
ERROR Plugin load failed: hexo-git-backup
ReferenceError: primordials is not defined
at fs.js:42:5
at req_ (H:\hexo blog\node_modules\natives\index.js:143:24)
at Object.req [as require] (H:\hexo blog\node_modules\natives\index.js:55:10)
at Object. (H:\hexo blog\node_modules\hexo-git-backup\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (H:\hexo blog\node_modules\hexo-git-backup\node_modules\graceful-fs\graceful-fs.js:3:27)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (H:\hexo blog\node_modules\hexo-git-backup\backup.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at req (H:\hexo blog\node_modules\hexo\lib\hexo\index.js:292:23)
at H:\hexo blog\node_modules\hexo-git-backup\index.js:10:66
at H:\hexo blog\node_modules\hexo\lib\hexo\index.js:305:14
at tryCatcher (H:\hexo blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (H:\hexo blog\node_modules\bluebird\js\release\promise.js:547:31)
backup:
type: git
repo:
gitee: [email protected]:jjkjachcu/hexo.git,master
`$ hexo b
(node:9124) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.
INFO Start backup: git
[master d609c34] Site updated: 2018-11-22 15:12:24
1 file changed, 1 deletion(-)
fatal: 'gitee' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git`
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 305 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Powered by Gitee.com
To [email protected]:jjkjachcu/hexo.git
447e5bc..d609c34 master -> master
使用hexo b不能正常push,只能手动push才成功
hexo版本:3.8.0
_config.yml
中配置如下:
backup:
type: git
theme: landscape,yilia
repository:
github: [email protected]:Coande/coande.github.io.git,hexo
报错如下:
INFO Start backup: git
INFO Setting up Git-Backup deployment...
INFO F:\__my__\blog\themes\yilia\.git
INFO First
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm install hexo-git-backup --save
npm WARN deprecated [email protected]: This package is no longer maintained
npm WARN deprecated [email protected]: This package is no longer maintained
npm WARN optional dep failed, continuing [email protected]
npm WARN optional dep failed, continuing [email protected]
[email protected] postinstall /home/fengkx/node_modules/hexo-git-backup/node_modules/hexo/node_modules/hexo-util
npm run build:highlight
\
[email protected] build:highlight /home/fengkx/node_modules/hexo-git-backup/node_modules/hexo/node_modules/hexo-util
node scripts/build_highlight_alias.js > highlight_alias.json
[email protected] install /home/fengkx/node_modules/hexo-git-backup/node_modules/hexo/node_modules/hexo-log/node_modules/bunyan/node_modules/dtrace-provider
node scripts/install.js
[email protected] node_modules/hexo-git-backup
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
你好,能否在命令后面添加一个参数用来记录每次的修改。
例如 hexo b 'Change theme'
配置写
backup:
type: git
theme: tranquilpeak
repository:
github: [email protected]:XXX/XXX.git,master
提示
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
配置写
backup:
type: git
theme: tranquilpeak
repository:
gitcafe: [email protected]:XXX/XXX.git,master
提示
fatal: 'gitcafe' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
是不是github/gitcafe这个关键字的处理出问题了
我在 _config.yml
中没有设置 theme
,为什么仍然备份了所有的主题,并且删掉了 .git
目录?
不知道为什么它说这个程序不再维护了,大家还能安装吗?
npm install hexo-git-backup --save
npm WARN deprecated [email protected]: This package is no longer maintained
➜ blog hexo backup
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
ReferenceError: hexo is not defined
at Hexo.module.exports (/Users/sche/blog/node_modules/hexo-git-backup/backup.js:7:16)
at Hexo.tryCatcher (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Hexo.ret (:13:39)
at /Users/sche/blog/node_modules/hexo/lib/hexo/index.js:192:9
at tryCatcher (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._resolveFromResolver (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:427:31)
at new Promise (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:53:37)
at Hexo.call (/Users/sche/blog/node_modules/hexo/lib/hexo/index.js:188:10)
at runHexoCommand (/usr/local/lib/node_modules/hexo-cli/lib/index.js:58:17)
at tryCatcher (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:79:16)
at Async._drainQueues (/Users/sche/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:89:10)
at Immediate.Async.drainQueues as _onImmediate
at processImmediate as _immediateCallback
大牛牛~
膜拜下~
ERROR Plugin load failed: hexo-git-backup
SyntaxError: Unexpected token var
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (/home/jason-ye/blog/node_modules/hexo/lib/hexo/index.js:213:21)
at /home/jason-ye/blog/node_modules/hexo-git-backup/index.js:10:66
at /home/jason-ye/blog/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:182:16)
at Async._drainQueues (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:192:10)
at Async.drainQueues (/home/jason-ye/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:15:14)
at process._tickCallback (node.js:415:13)
INFO Validating config
ERROR {
err: TypeError: os.tmpDir is not a function
at Object. (/Users/phoenine/Documents/MyBlog/hexo/node_modules/temp/lib/temp.js:142:32)
at Module._compile (node:internal/modules/cjs/loader:1091:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:10)
at Module.load (node:internal/modules/cjs/loader:971:32)
at Function.Module._load (node:internal/modules/cjs/loader:812:14)
at Module.require (node:internal/modules/cjs/loader:995:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object. (/Users/phoenine/Documents/MyBlog/hexo/node_modules/execSync/index.js:6:12)
at Module._compile (node:internal/modules/cjs/loader:1091:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1120:10)
at Module.load (node:internal/modules/cjs/loader:971:32)
at Function.Module._load (node:internal/modules/cjs/loader:812:14)
at Module.require (node:internal/modules/cjs/loader:995:19)
at req (/Users/phoenine/Documents/MyBlog/hexo/node_modules/hexo/lib/hexo/index.js:292:23)
at /Users/phoenine/Documents/MyBlog/hexo/node_modules/hexo-git-backup/index.js:2:11
at /Users/phoenine/Documents/MyBlog/hexo/node_modules/hexo/lib/hexo/index.js:305:14
at tryCatcher (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/phoenine/Documents/MyBlog/hexo/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (node:internal/timers:464:21)
} Plugin load failed: %s hexo-git-backup
INFO Start backup: git
[master 36f3d04] Site updated: 2017-03-19 19:21:14
1 file changed, 1 insertion(+), 1 deletion(-)
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
whats wrong?what should i do?
$ hexo deploy
ERROR Plugin load failed: hexo-renderer-scss
Error: Missing binding E:\hexo\blog\node_modules\node-sass\vendor\win32-x64-64\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x
Found bindings for the following environments:
This usually happens because your environment has changed since running npm install
.
Run npm rebuild node-sass --force
to build the binding for your current environment.
at module.exports (E:\hexo\blog\node_modules\node-sass\lib\binding.js:15:13)
at Object. (E:\hexo\blog\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (E:\hexo\blog\node_modules\hexo-renderer-scss\lib\renderer.js:1:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (E:\hexo\blog\node_modules\hexo\lib\hexo\index.js:219:21)
at E:\hexo\blog\node_modules\hexo-renderer-scss\index.js:1:81
at fs.readFile.then.script (E:\hexo\blog\node_modules\hexo\lib\hexo\index.js:232:12)
at tryCatcher (E:\hexo\blog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (E:\hexo\blog\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (E:\hexo\blog\node_modules\bluebird\js\release\promise.js:569:18)
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
INFO Copying files from extend dirs...
fatal: not a git repository (or any of the parent directories): .git
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: fatal: not a git repository (or any of the parent directories): .git
at ChildProcess.<anonymous> (E:\hexo\blog\node_modules\hexo-util\lib\spawn.js:37:17)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.cp.emit (E:\hexo\blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
# 配置文件
backup:
type: git
message: Hexo Blog
theme: next
repository:
github: https://github.com/linancc/linancc.github.io.git,hexo-git-backup
# 报错信息
$ hexo b
INFO Start backup: git
On branch master
nothing to commit, working tree clean
remote: Repository not found.
fatal: repository 'https://github.com/linancc/linancc.github.io.gits/' not found
INFO Backup done: git
我新建了一个仓库blog-backup
专门去进行备份博客,我安装你的说明文档,安装完这个插件后,在站点目录的配置文件_config.yml
新增如下的配置项:
backup:
type: git
repository:
github: https://github.com/wangleeyom/blog-backup.git,master
但是我在写完一篇文章后,执行:
hexo g
hexo d
hexo b
三条命令后,文章是发布成功,但是却没有备份成功,仓库blog-backup
下面依旧是空的啥也没有,执行hexo b
命令后,终端提示如下信息:
$ hexo b
INFO Start backup: git
On branch master
Changes not staged for commit:
modified: themes/yelee (modified content, untracked content)
no changes added to commit
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
请问这个问题到底是啥原因呢?
[execsync v1.0.2] Attempting to compile native extensions.
{ [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' }
[execSync v1.0.2]
Native code compile failed!!
Will try to use win32 extension.
[email protected] node_modules\hexo-git-backup
├── [email protected] ([email protected])
└── [email protected] ([email protected])
出现这样
You should configure backup settings in _config.yml first!
Available Types:
git
For more help, you can check the online docs: https://github.com/coneycode/hexo-git-backup
有没有给备份分支备份readme的功能 没有就加一个吧
backup:
type: git
theme: indigo
repository:
github: [email protected]:Captainzj/hexo_backup.git,master
gitcafe: [email protected]:Captainzj/hexo_backup.git,master
➜ _posts git:(master) ssh -T [email protected]
Hi Captainzj! You've successfully authenticated, but GitHub does not provide shell access.
➜ _posts git:(master) ✗ git remote -v
gitcafe [email protected]:Captainzj/hexo_backup.git (fetch)
gitcafe [email protected]:Captainzj/hexo_backup.git (push)
github [email protected]:Captainzj/hexo_backup.git (fetch)
github [email protected]:Captainzj/hexo_backup.git (push)
➜ _posts git:(master) ✗ sudo hexo b
INFO Start backup: git
[master f05cad9] Site updated: 2018-11-19 22:20:37
1 file changed, 2 insertions(+), 3 deletions(-)
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
我试了已解决的几种方法,但依旧不能备份成功
INFO Start backup: git
INFO Setting up Git-Backup deployment...
INFO E:\OneDrive\Blog\themes\butterfly.git
INFO First
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', '.git' ]
}
配置如下:
backup:
type: git
theme: landscape
message: update
repository:
gitee: [email protected]:xxxxx/xxx.git,master
报错:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
直接使用 git 命令可以正常提交和拉取,但使用 hexo back
会报错误,请问 hexo-git-backup 支持备份到 gitee 吗?
[ [ 'add', '-A' ], [ 'add', 'F:\blog\themes\next\*' ] ]
INFO F:\blog\themes\next.git
events.js:180
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', '.git' ]
由于我取消了全局的name和email设置,导致无法使用插件备份。部署的时候,官方的配置参数项有name和email的配置,同时删除隐藏的部署目录,重新编译即可。可否增加对指定账号的支持?
我的配置是这样的
backup:
type: git
repository:
github: [email protected]:nsleep/nsleep.github.io.git,backup
我在执行hexo b
后,控制台显示
INFO Start backup: git
[backup 0431bed] Site updated: 2020-02-29 21:16:51
1 file changed, 1 insertion(+), 1 deletion(-)
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
我在node_modules/hexo-git-backup/git.js
文件中加入一行以显示执行的命令 (行77)
出现以下提示
nothing to commit, working tree clean
git [ 'push', '-u', 'github', 'master:backup', '--force' ]
fatal: 'github' does not appear to be a git repository
fatal: Could not read from remote repository.
以此可见错误原因。
然后自己YY了一个解决方案——
将这一行(行135)
commands.push(['push', '-u', t, 'master:' + repo[t].branch, '--force']);
改成
commands.push(['push', '-u', t, 'backup:' + repo[t].branch, '--force']);
配置文件中github
更改为origin
INFO Start backup: git
git [ 'add', '-A' ]
git [ 'commit', '-m', 'Site updated: 2020-03-01 11:11:38' ]
[backup 3878af7] Site updated: 2020-03-01 11:11:38
1 file changed, 2 insertions(+), 1 deletion(-)
git [ 'push', '-u', 'origin', 'backup:backup', '--force' ]
Branch 'backup' set up to track remote branch 'backup' from 'origin'.
To https://github.com/nsleep/nsleep.github.io
dd809ad..3878af7 backup -> backup
INFO Backup done: git
问题解决!
Use Git Clone?
I Mean a hexo command for recovery is needed for newbie。
PS D:\GitHub\hexo.bak> hexo b
INFO Validating config
INFO DPlayer.min.css is not found in this version of dplayer, skip it.
INFO Start backup: git
[
[ 'add', '-A' ],
[ 'add', 'D:\GitHub\hexo.bak\themes\Kratos-Rebirth\*' ]
]
INFO D:\GitHub\hexo.bak\themes\Kratos-Rebirth.git
events.js:352
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
at onErrorNT (internal/child_process.js:467:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', '.git' ]
}
PS D:\GitHub\hexo.bak>
不懂。。。
貌似会覆盖deploy的git文件,所以再使用hexo deploy会将整个目录都丢上pages的仓库
git clone -o github *.git
然后 checkout 到了 backup 分支
一番修改之后 hexo b备份
然而 远程仓库backup的内容是 本地master的
~$ npm install hexo-git-backup --save
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "_@[email protected]@@babel": name cannot start with an underscore; name can only contain URL-friendly characters
events.js:287
throw er; // Unhandled 'error' event
^
hexo backup
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', '.git' ]
}
next 内置四个主题 安装 这个后居然四个主题就混搭了hh
比如我在一台电脑上备份了主题,然后想在另一台电脑上把备份的主题下载下来,有命令可以操作吗?
looks like the hexo backup works , but always generate the error below
chchang@ubuntu1804hexo:~/hexo$ sudo hexo b
(node:17334) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
ERROR Plugin load failed: hexo-backup
Error: Cannot find module './build/Release/shell'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/chchang/hexo/node_modules/execSync/index.js:30:11)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (/home/chchang/hexo/node_modules/hexo/lib/hexo/index.js:216:21)
at /home/chchang/hexo/node_modules/hexo-backup/index.js:2:11
at /home/chchang/hexo/node_modules/hexo/lib/hexo/index.js:232:12
at tryCatcher (/home/chchang/hexo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/home/chchang/hexo/node_modules/bluebird/js/release/promise.js:524:17)
INFO Start backup: git
On branch master
Your branch is ahead of 'github/master' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
INFO Backup done: git
INFO Total precache size is about 16.3 MB for 539 resources.
any suggestions ??
ERROR Plugin load failed: hexo-git-backup
SyntaxError: Unexpected token var
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (/Users/hrj/blog/node_modules/hexo/lib/hexo/index.js:213:21)
at /Users/hrj/blog/node_modules/hexo-git-backup/index.js:10:66
at /Users/hrj/blog/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:454:31)
at Promise._settlePromiseAt (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:79:16)
at Async._drainQueues (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:89:10)
at Async.drainQueues (/Users/hrj/blog/node_modules/hexo/node_modules/bluebird/js/main/async.js:14:14)
at process._tickCallback (node.js:419:13)
以前的 coding 仓库地址类似于 [email protected]/xxxx
,现在 coding 更新了,同一个仓库,但是仓库地址变了,现在是类似于 [email protected]/xxxx
,我在 '_config.yml' 配置文件里面更改了仓库名,执行 hexo b
报错,显示的仍然是以前的仓库名。
'_config.yml' 配置文件:
报错信息:
我也尝试过重新生成 SSH,但是没有用,一直都是以前这个仓库名,请问应该如何解决?
你好,我是直接在github中新建了backup
分支
在hexo博客根目录下执行git init
,然后使用hexo b
时报错,具体错误:
$ hexo b
INFO Start backup: git
On branch backup
nothing to commit, working tree clean
error: src refspec master does not match any.
error: failed to push some refs to 'github'
INFO Backup done: git
下面是我``配置:
backup:
type: git
message: backup my blog of https://www.xiongtianci.com
repository:
# 你的github仓库地址,备份分支名(建议新建 backup 分支)
github: [email protected]:xiongtianci-tc/xiongtianci-tc.github.io.git,backup
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.