“配置Github使用Token登录验证”的版本间的差异

来自YTYZX有图有真相的百科
跳转至: 导航搜索
第1行: 第1行:
  使用“git push origin main”推送代码到github时报如下错误:
+
   背景: 使用“git push origin main”推送代码到github时报如下错误:
 
  remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
 
  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.
 
  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/zhoulujun/algorithm.git/': The requested URL returned error: 403
 
 
  大意为:github在2021年8月13日移除密码认证的支持,在使用命令行或API的时候,建议创建一个个人访问令牌(personal access token)来代替密码
 
  大意为:github在2021年8月13日移除密码认证的支持,在使用命令行或API的时候,建议创建一个个人访问令牌(personal access token)来代替密码
 +
 
  1.登录github后在页面右上角点击您的头像。
 
  1.登录github后在页面右上角点击您的头像。
  
 
[[File:GithubToken1.png]]
 
[[File:GithubToken1.png]]
  
  2.
+
  2. 点击“Settings”按钮。
 +
 
 +
[[File:GithubToken2.png]]
 +
 
 +
 
 
 如果您有令牌,则可以在通过 HTTPS 执行 Git 操作时输入令牌,而不是密码。
 
 如果您有令牌,则可以在通过 HTTPS 执行 Git 操作时输入令牌,而不是密码。
  

2021年12月19日 (日) 14:08的版本

背景:使用“git push origin main”推送代码到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.
大意为:github在2021年8月13日移除密码认证的支持,在使用命令行或API的时候,建议创建一个个人访问令牌(personal access token)来代替密码
1.登录github后在页面右上角点击您的头像。

GithubToken1.png

2.点击“Settings”按钮。

GithubToken2.png


如果您有令牌,则可以在通过 HTTPS 执行 Git 操作时输入令牌,而不是密码。

例如,在命令行中输入以下内容:

$ git clone https://github.com/username/repo.git Username: your_username Password: your_token