想搭建一個個人博客,但是在將博客推送到Github上的時候在git bash 下運行hexo g -d命令出現錯誤:
錯誤如下:
fatal: HttpRequestException encountered.
▒▒▒▒▒▒▒▒ʱ▒▒▒▒
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for '
https://github.com': No error
FATAL Something's wrong. Maybe you can find the solution here:
http://hexo.io/do
▒▒▒▒▒▒▒▒ʱ▒▒▒▒
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for '

FATAL Something's wrong. Maybe you can find the solution here:

cs/troubleshooting.html
Error: fatal: HttpRequestException encountered.
ʱ
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for '
https://github.com': No error
at ChildProcess.<anonymous> (F:\blog\
huahua462.github.io\node_modules\hexo-u
Error: fatal: HttpRequestException encountered.
ʱ
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for '

at ChildProcess.<anonymous> (F:\blog\

til\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (F:\blog\
huahua462.github.io\node_modules\cross-spaw
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (F:\blog\

n\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
解決方案:
首先在“你GitHub注冊用戶名.github.io”本地文件夾下有一個名為“_config.yml”的配置文件,這個稱為站點配置文件,使用NotePad++打開並拉到文件最后,將:
deploy: type: git repo: https://github.com/你GitHub注冊用戶名/你GitHub注冊用戶名.github.io.git branch: master
改為:
deploy: type: git repo: git@github.com:你GitHub注冊用戶名/你GitHub注冊用戶名.github.io.git branch: master
即可;親測有效