OpenSSH Username for 'https://github'
Password for 'https://你的github邮箱@github.com'
输入以下命令查看返回结果
$ ssh -T git@github.com
?
以下结果说明git与github绑定成功,否则失败
Hi 这里为自己的github用户名! You've successfully authenticated, but GitHub does not provide shell access.
返回:
up to date in 2m
28 packages are looking for funding
? run `npm fund` for details
不用管
输入以下语句
$ npm install hexo-deployer-git --save
返回以下结果,不用管
up to date in 2m
28 packages are looking for funding
run `npm fund` for details
Git Bash执行
$ hexo clean
正确返回结果
INFO Validating config
INFO Deleted database.
INFO Deleted public folder.
Git Bash执行
$ hexo g
正确初始化结果
INFO Validating config
INFO Start processing
INFO Files loaded in 532 ms
INFO Generated: archives/2024/index.html
INFO Generated: archives/index.html
INFO Generated: archives/2024/01/index.html
INFO Generated: index.html
INFO Generated: css/style.css
INFO Generated: fancybox/jquery.fancybox.min.css
INFO Generated: fancybox/jquery.fancybox.min.js
INFO Generated: js/script.js
INFO Generated: js/jquery-3.6.4.min.js
INFO Generated: css/images/banner.jpg
INFO Generated: 2024/01/09/hello-world/index.html
INFO 11 files generated in 550 ms
当执行以下命令时报错Error: Spawn failed
$ hexo d
报错内容如下
Error: Spawn failed
《把自己的github的https仓库地址》——>《换成自己github的SSH地址》
把原来github仓库的https地址用##号注释掉
? ? ? ?type:后面有空格隔开
? ? ? ?repo:后面有空格隔开
? ? ? ?branch:后面有空格隔开
原有的为这样
deploy:
type: git
repository: https://自己的github的https仓库地址.io.git
branch: main
修改后的为这样
deploy:
type: git
##repository: https://自己的github的https仓库地址.io.git
repo: 这里换成自己github的SSH地址.io.git
branch: main
把原来github仓库的https地址用##号注释掉
注意事项:
type:后面有空格隔开
repo:后面有空格隔开
branch:后面有空格隔开
?
?
?
?
?