GitHub: invalid username or password解决方法

  1. 问题

当我们使用 Git push / clone 等命令,想从远程仓库拉取 或者 更新代码时,出现如下错误:

Password for 'https://git@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://git@github.com/XXX/XXX.git/'

则是提示你账号密码错误。

  1. 原因

常见原因是因为你 Git 上的密码有更改过了,导致无法操作

  1. 解决方法

电脑(Win10为例) -> 运行 -> 控制面板 -> 凭据管理器 ->Windows 凭据 -> 普通凭据

点击 https://git@github.com 选项,然后点击 编辑, 即可修改 用户名 和 密码

参考:

https://stackoverflow.com/questions/29297154/github-invalid-username-or-password

此外,如果有遇到:GitHub - fatal: could not read Username for 'https://github.com': No such file or directory

则可以在Android Studio 设置: File > Settings > Git > Use Credential Helper 勾选

参考: https://stackoverflow.com/questions/22147574/github-fatal-could-not-read-username-for-https-github-com-no-such-file-o

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值