问题描述

​ 今天在提交博客源码到仓库的时候,输入正确的账号和密码发现提交失败并提示

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information

大概意思是从2021年8月13号开始。使用个人令牌代替密码登录。于是参考以下帖子解决https://blog.csdn.net/weixin_41010198/article/details/119698015。

问题的解决

  1. 打开github的settingsdeveploer settings
  2. 点击Personal access tokens
  3. 这个Personal access tokens只出现一次要保存起来。
  4. 把这个token替换在hexo的_config.yml文件 部署模块中的repo
1
2
3
4
5
6
7
8
9
10
11
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
- type: git
## repo: https://github.com/zhouduforgit/zhouduforgit.github.io.git oldCode
repo: https://zhouduforgit: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@github.com/zhouduforgit/zhouduforgit.github.io.git
branch: main
- type: git
repo: git@118.31.250.190:/home/git/blog.git
branch: master
- type: baidu_url_submitter