gpt4 book ai didi

linux - git 推送错误 : could not read Username for 'https://github.com' : Permission denied

转载 作者:太空宇宙 更新时间:2023-11-04 09:33:41 27 4
gpt4 key购买 nike

我在 CentOS 7 上并尝试推送到 github。首先我使用的是 ssh,但我的系统似乎有一些奇怪的错误,我的 ssh key 不断消失(我知道这令人难以置信,但我没有其他解释。)相反,我一直在尝试使用 https,但我无法推送到 github,不知道为什么。这是发生了什么:

$ git push origin remote
fatal: could not read Username for 'https://github.com': Permission denied

你能帮忙吗?

最佳答案

如果你想使用 https,你需要你的 repo 的完整 url:

git remote set-url https://<yourLogin>@github.com/<yourLogin>/<yourRepo>

然后你可以试试git push
这将要求您提供 GitHub 帐户密码,除非您已激活 2FA(请参阅“About Two-Factor Authentication”),在这种情况下,您需要先生成一个 PAT (Personnal Acces Token)。 .

关于linux - git 推送错误 : could not read Username for 'https://github.com' : Permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28864813/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com