coneycode / hexo-git-backup

you can use it to backup your blog into git.
MIT License
457 stars 66 forks source link

无法提交到指定的备份source分支,git.js 内存在错误 #44

Open yantao1995 opened 4 years ago

yantao1995 commented 4 years ago

原错误信息

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']);
      }

成功提交。

coneycode commented 4 years ago

收到,我检查下~