打开github--->setting--->SSH and GPG keys--->New ssh key
打开.ssh路径,将id_rsa.pub的内容复制到新创建的ssh key里面
测试是否连接到github
1 2 3 4 5 6 7 8
>>>ssh -T git@github.com ssh: connect to host github.com port 22: Connection timed out #连接失败
# 如果是出现以下则说明成功,以下的文章就不用看了 The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? # 此时在此输入yes回车就行
>>>ssh -T git@github.com #此时出现以下页面成功啦 The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes # 此处输入yes Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts. Hi 0000rookie! You've successfully authenticated, but GitHub does not provide shell access.
GitHub部署博客出现404错误
分两种情况
还未修改域名
打开GitHub仓库看文件是否已经上传成功,成功如图。
如果仓库是空的,说明你没上传成功。
检查blog 文件夹下的_config.yml文件deploy:的配置有没有正确。如下
1 2 3 4
deploy: type: git repo: git@github.com:0000rookie/github.io.git branch: main
重新部署到github仓库。
1 2 3
hexo clean #清除缓存文件 db.json 和已生成的静态文件 public hexo g #生成网站静态文件到默认设置的 public 文件夹(hexo generate 的缩写) hexo d #自动生成网站静态文件,并部署到设定的仓库(hexo deploy 的缩写)
lilbai518@▒▒С▒▒ MINGW64 /e/Blog $ hexo b INFO Validating config INFO Start backup: git fatal: detected dubious ownership in repository at 'E:/Blog' To add an exception for this directory, call:
git config --global --add safe.directory E:/Blog
Set the environment variable GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true and run again for more information. fatal: detected dubious ownership in repository at 'E:/Blog' To add an exception for this directory, call:
git config --global --add safe.directory E:/Blog
Set the environment variable GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true and run again for more information. fatal: detected dubious ownership in repository at 'E:/Blog' To add an exception for this directory, call:
git config --global --add safe.directory E:/Blog
Set the environment variable GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true and run again for more information. fatal: detected dubious ownership in repository at 'E:/Blog' To add an exception for this directory, call:
git config --global --add safe.directory E:/Blog
Set the environment variable GIT_TEST_DEBUG_UNSAFE_DIRECTORIES=true and run again for more information. INFO Backup done: git
执行完后,发现端口多了个(master)标识,说明本地仓库已经没问题了,这样直接执行hexo b 试一下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
lilbai518@▒▒С▒▒ MINGW64 /e/Blog (master) $ hexo b INFO Validating config INFO 。。。中间省略
fatal: 'githu' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. fatal: 'gitee' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. INFO Backup done: git
>>> hexo s FATAL Port 4000 has been used. Try other port instead. FATAL { err: Error: listen EADDRINUSE: address already in use :::4000 at Server.setupListenHandle [as _listen2] (net.js:1331:16) at listenInCluster (net.js:1379:12) at Server.listen (net.js:1465:7) at E:\Blog\node_modules\hexo-server\lib\server.js:68:12 at Promise._execute (E:\Blog\node_modules\bluebird\js\release\debuggability.js:384:9) at Promise._resolveFromExecutor (E:\Blog\node_modules\bluebird\js\release\promise.js:518:18) at new Promise (E:\Blog\node_modules\bluebird\js\release\promise.js:103:10) at checkPort (E:\Blog\node_modules\hexo-server\lib\server.js:65:10) at Hexo.module.exports (E:\Blog\node_modules\hexo-server\lib\server.js:17:10) at Hexo.tryCatcher (E:\Blog\node_modules\bluebird\js\release\util.js:16:23) at Hexo.<anonymous> (E:\Blog\node_modules\bluebird\js\release\method.js:15:34) at Hexo.call (E:\Blog\node_modules\hexo\lib\hexo\index.js:258:27) at E:\studyAPP\node_js\node_global\node_modules\hexo-cli\lib\hexo.js:60:17 at tryCatcher (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromise0 (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:649:10) at Promise._settlePromises (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:729:18) at _drainQueueStep (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:93:12) at _drainQueue (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues (E:\studyAPP\node_js\node_global\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:15:14) { code: 'EADDRINUSE', errno: -4091, syscall: 'listen', address: '::', port: 4000 } } Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html
LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character ":" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "利" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "用" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "率" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "有" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "效" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "工" used in math mode [unicodeTextInMathMode] LaTeX-incompatible input and strict mode is set to 'warn': Unicode text character "作" used in math mode [unicodeTextInMathMode]