Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
834 views
in Technique[技术] by (71.8m points)

hexo 博客搭建时出现的问题

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
ode_moduleshexo-utillibspawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:Blog
ode_modulescross-spawnlibenoent.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
ode_moduleshexo-utillibspawn.js:37:17)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (G:Blog
ode_modulescross-spawnlibenoent.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)


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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"

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

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...