今天提交代码,push 到 GitHub 上,突然出现这个问题。
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.
fatal: unable to access 'https://github.com/wsgzao/wsgzao.github.io.git/': The requested URL returned error: 403
官方的解释:https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/
As previously announced, starting on August 13, 2021, at 09:00 PST, we will no longer accept account passwords when authenticating Git operations on GitHub.com. Instead, token-based authentication (for example, personal access, OAuth, SSH Key, or GitHub App installation token) will be required for all authenticated Git operations.
Please refer to this blog post for instructions on what you need to do to continue using git operations securely.
Removal
- August 13, 2021, at 09:00 PST
大致意思是,密码验证于 2021 年 8 月 13 日不再支持,也就是今天 intellij 不能再用密码方式去提交代码。请用使用 personal access token 替代。
这个去年年底就说了,https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
In July 2020, we announced our intent to require the use of token-based authentication (for example, a personal access, OAuth, or GitHub App installation token) for all authenticated Git operations. Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com.
自己鼓捣了一遍 Token,烦人的很。还是觉得直接 ssh 的方式操作 git 就好(之前是 ssh 的源,也没有这个问题)。
以下两种解决方案推荐使用 SSH 免密登录
# 登录 github 添加 SSH and GPG keys 公钥
# 修改 git config
vim wsgzao.github.io/.git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = https://github.com/wsgzao/wsgzao.github.io.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
# 替换 url =
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote "origin"]
url = git@github.com:wsgzao/wsgzao.github.io.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Google 搜索到以下文章具体步骤非常详细,我就直接贴链接不再重复了
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.