GitHub:无效的用户名或密码 [英] GitHub: invalid username or password

查看:2945
本文介绍了GitHub:无效的用户名或密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管在GitHub上的项目。当我试图推动对主人的修改时,我失败了。我总是收到以下错误消息:

 'https://git@github.com'的密码:
远程:无效的用户名或密码。
致命:https://git@github.com/eurydyce/MDANSE.git/身份验证失败

但是,将我的ssh密钥设置为github似乎没问题。事实上,当我做一个 ssh -T git@github.com 我得到

 嗨eurydyce!您已成功通过身份验证,但GitHub不提供shell访问权限。 

这似乎表明,从这一方面来看,一切正常(eurydyce是我的github用户名)。我严格按照github上给出的指示和许多堆栈讨论的建议,但没有办法。你有什么想法,我可能做错了什么? https://git@github.com/eurydyce/MDANSE.git 不是一个ssh网址,它是一个https网址(这需要你GitHub帐号名称,而不是' git ')。



尝试使用 ssh: //git@github.com:eurydyce/MDANSE.git 或者只是 git@github.com:eurydyce / MDANSE.git

  git remote set-url origin git@github.com:eurydyce / MDANSE.git 

OP Pellegrini Eric 补充说:


这就是我在我的〜/ .gitconfig 文件中所做的,该文件目前包含以下条目 [remoteorigin] url=git@github.com:eurydyce / MDANSE.git


这不应该在您的全局配置中(o 〜/ )。

你可以在你的repo中检查 git config -l <​​/ code>该url应该在 local config中声明:< yourrepo> / .git / config



因此,在执行 git remote set-url 命令时,请确保您在回购路径中。


I have a project hosted on GitHub. I fail when trying to push my modifications on the master. I always get the following error message

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

However, setting my ssh key to github seems ok. Indeed, when I do a ssh -T git@github.com I get

Hi eurydyce! You've successfully authenticated, but GitHub does not provide shell access.

Which seems to indicate that everything is OK from that side (eurydyce being my github username). I strictly followed the instructions given on github and the recommendations of many stack discussion but no way. Would you have any idea of what I may have done wrong?

解决方案

https://git@github.com/eurydyce/MDANSE.git is not an ssh url, it is an https one (which would require your GitHub account name, instead of 'git').

Try to use ssh://git@github.com:eurydyce/MDANSE.git or just git@github.com:eurydyce/MDANSE.git

git remote set-url origin git@github.com:eurydyce/MDANSE.git

The OP Pellegrini Eric adds:

That's what I did in my ~/.gitconfig file that contains currently the following entries [remote "origin"] url=git@github.com:eurydyce/MDANSE.git

This should not be in your global config (the one in ~/).
You could check git config -l in your repo: that url should be declared in the local config: <yourrepo>/.git/config.

So make sure you are in the repo path when doing the git remote set-url command.

这篇关于GitHub:无效的用户名或密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆