hexo 发布到Github的时候致命的问题~~求帮助!!

浏览:45日期:2023-09-13

问题描述

问题描述: 是这样子的,之前看到一个文章用hexo搭建一个博客,教程是这个,根据这个一步步走下来,提交到A账号的的github是没有问题的。

但是我再想搭建一个,然后根据这个教程一步步走下来,然后到提交的B账号的时候hexo clean && hexo g && hexo d, 发现一个致命的bug,怎么都解决不了~~如下图

hexo 发布到Github的时候致命的问题~~求帮助!!

报错内容

remote: Permission to naihe138/naihe138.github.io.git denied to blueSky1115.fatal: unable to access ’https://github.com/naihe138/naihe138.github.io.git/’: The requested URL returned error: 403FATAL Something’s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.htmlError: remote: Permission to naihe138/naihe138.github.io.git denied to blueSky1115.fatal: unable to access ’https://github.com/naihe138/naihe138.github.io.git/’: The requested URL returned error: 403 at ChildProcess.<anonymous> (/Users/naihe/naihe138.github.io/node_modules/hexo-util/lib/spawn.js:37:17) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at maybeClose (internal/child_process.js:827:16) at Socket.<anonymous> (internal/child_process.js:319:11) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at Pipe._onclose (net.js:477:12)

求大神帮助解决一下,困扰了好久好久~~~

问题解答

回答1:

碰到一个一模一样的问题解决方案是在 hexo _config.yml部署的repo地址改用ssh而不是用https

repository: git@github.com:Name/Name.github.io.git

但这是为什么呢?好奇怪

回答2:

错误提示的意思是:naihe138.github.io.git 拒绝了blueSky1115的push请求。

这是因为在缺省设置下,gitbub page是private project,只有该page对应的账号能push(也就是naihe138这个账号)。而根据你的描述,已经完成了A账号的设置。我想,在你本地的hexo文件夹中的github账号已经设定成naihe138了。

我能想到的最快的解决方案,给naihe138.github.io.git这个repo中,为blueSky1115 添加可以push的权限。

如果上述的不可行,那么你需要做一些设置,使得你可以push到naihe138.github.io。具体的操作请参考这个页面:http://memoryboxes.github.io/...。

相关文章: