【已解决】Git下载私有仓库时报错Authentication failed

用git下载partner提供的private repo时,提示需要输入username和password。但怎么输入都报Authentication failed 的错误。
报错log:

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for ‘https://github.com/xxx/xxx’

于是求得方法:https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

本文根据上述链接整理出步骤:

  1. 拿到你的token。打开github,进入settings,再进入developer settings
    在这里插入图片描述
  2. 找到这个personal access tokens,点击Generate new token,随便取个note名字然后把repo的操作权限勾上:
    在这里插入图片描述
    点击生成以后,就得到一串token,这串token就是你的临时密码了~
    在这里插入图片描述
  3. 最后只需:
git clone https://github.com/username/repo.git
Username: your_username
Password: your_token
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

木盏

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值