hexo 博客搭建时出现的问题

发布于 2022-09-04 18:54:48 字数 1519 浏览 6 评论 0

hexo d时出现下面的问题:
$ hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
fatal: bad config file line 1 in .git/config
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troublesh...
Error: fatal: bad config file line 1 in .git/config

at ChildProcess.<anonymous> (G:\Blog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:\Blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:886:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)

FATAL fatal: bad config file line 1 in .git/config

Error: fatal: bad config file line 1 in .git/config

at ChildProcess.<anonymous> (G:\Blog\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:\Blog\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:886:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)


找了好久 没找出哪里出了问题

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

转身泪倾城 2022-09-11 18:54:48

如果你要往github上传请先安装git
然后配置

$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"

安装必要插件
npm install hexo-deployer-git --save

在_config.yml添加一下配置
deploy:

 type: git
 repo: https://github.com/yourname/yourname.github.io.git
 branch: master

晨曦÷微暖 2022-09-11 18:54:48

deploy:
type: git
repository:

github: git@github-fastzhong:fastzhong/fastzhong.github.io.git
coding: git@coding-fastzhong:fastzhong/fastzhong.git
branch: master
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文