如何让命令行在克隆仓库时重新提示github的用户名/密码

o4tp2gmn  于 2024-01-04  发布在  Git
关注(0)|答案(1)|浏览(119)

我刚开始使用github,我所在班级的教授正在将源代码和作业信息存储在一个存储库中,我需要使用以下命令git clone https://github etc. etc.克隆该存储库
我第一次被提示时输入了错误的Github用户名和密码,现在我被像remote: Invalid username or password fatal: Authentication failed这样的失败认证卡住了,因为它不会重新提示我。对这个问题有什么见解吗?网上的一些东西似乎可以通过摆弄一个名为credential.helper的东西来解决这个问题,但没有明确说明这会有什么帮助。

ezykj2lf

ezykj2lf1#

如果您使用的是Windows,请参阅“How do I sign out in the Git Bash console on Windows?

printf "protocol=https\nhost=github.com" | git credential-manager reject 
# or
printf "protocol=https\nhost=github.com" | git credential-manager erase

字符串
如果您使用的是Mac,请参阅“Updating credentials from the OSX Keychain
另请参阅this answer,但将“erase“替换为“delete“或“erase“。”

相关问题