zki*_*and 583 git authentication github
我一直在使用Github上一小会儿,我一直罚款git add,git commit以及git push到目前为止,没有任何问题.突然间我有一个错误说:
致命:身份验证失败
在终端我克隆了一个存储库,处理了一个文件然后我用来git add将文件添加到提交日志中,当我这样做时git commit,它运行正常.最后,git push要求输入用户名和密码.我正确地把它们放进去,每次我这样做,它都说同样的错误.
有谁知道这个问题的原因是什么以及我如何解决它?
内容.git/config是:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = http://www.github.com/######/Random-Python-Tests
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = #####
email = ############
Run Code Online (Sandbox Code Playgroud)
rc0*_*c0r 1046
如果您在Github帐户中启用了双因素身份验证,则无法使用您的帐户密码通过HTTPS推送.相反,您需要生成个人访问令牌.这可以在您的Github帐户的应用程序设置中完成.使用此令牌作为密码应该允许您通过HTTPS推送到远程存储库.照常使用您的用户名.
https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
如果设置为https,您可能还需要更新存储库的源:
git remote -v
git remote remove origin
git remote add origin git@github.com:user/repo.git
Run Code Online (Sandbox Code Playgroud)
Pra*_*eep 452
请尝试以下步骤来编辑或删除已保存的凭据:
Windows Credentials Manager快捷方式,然后双击它以打开该应用程序.Windows Credentials选项卡.小智 64
这对我有用,它还记得我的证书:
运行gitbash
指向repo目录
跑 git config --global credential.helper wincred
Von*_*onC 57
首先,您可以确保使用正确的URL:
git remote set-url origin https://github.com/zkirkland/Random-Python-Tests.git
Run Code Online (Sandbox Code Playgroud)
然后,如果它之前正在工作,并且它没有要求您使用用户名,那一定是因为您已将凭据(登录/密码)存储在$HOME/.netrc文件中,如此处所述.您可以仔细检查这些设置,并确保您的代理(如果有的话)没有更改.
如果仍然无效,您可以切换到ssh网址:
git remote set-url origin git@github.com:zkirkland/Random-Python-Tests.git
Run Code Online (Sandbox Code Playgroud)
但这意味着您已在帐户设置中发布了ssh公钥.
小智 54
您最近是否为git帐户更改了密码您可以尝试使用git pushwith -u选项
git push -u origin branch_name_that_you_want_to_push
Run Code Online (Sandbox Code Playgroud)
执行上述命令后,它会要求输入密码提供密码
希望它可以帮到你
小智 35
基本上我的凭证已过期,我面临上述问题.
以下2命令帮助我:
git config --global --unset credential.helper
git config credential.helper store
Run Code Online (Sandbox Code Playgroud)
当您尝试推送时,它会在下次询问您的凭据.
有关用户名和密码的安全和不安全存储的更多详细信息,请遵循以下准则:
https://git-scm.com/docs/git-credential-store
https://git-scm.com/docs/git-credential-cache
Hoq*_*dul 32
如果您在输入正确的密码和用户名时发现身份验证错误问题,那就是git问题.要在计算机中安装git时解决此问题,请取消选中enable git credential manager
Ele*_*cto 25
我认为由于某种原因,GitHub期望URL不具有子域名www.当我使用(例如)
git remote set-url origin https://www.github.com/name/repo.git
Run Code Online (Sandbox Code Playgroud)
它给出了以下消息:
remote: Anonymous access to name/repo.git denied
fatal: Authentication failed for https://www.github.com/name/repo.git
Run Code Online (Sandbox Code Playgroud)
但是,如果我使用
git remote set-url origin https://github.com/name/repo.git
Run Code Online (Sandbox Code Playgroud)
它工作得很好.对我来说没有多大意义......但我想记得不要把www放在GitHub存储库的远程URL中.
另请注意,GitHub存储库网页上提供的克隆URL不包含www.
frm*_*elz 17
同样的错误(Windows、Git Bash 命令行)。使用 https 应该提示输入登录凭据,但会出现错误:
$ git pull origin master
fatal: Authentication failed for 'https://github.com/frmbelz/my_git_project.git'
Run Code Online (Sandbox Code Playgroud)
$ git config -l
...
credential.helper=manager
...
$ git config --global --unset credential.helper
$ git config --system --unset credential.helper
Run Code Online (Sandbox Code Playgroud)
git pull现在提示输入用户名/密码提示。
Cha*_*Zoo 16
嗨,我遇到了同样的错误,我尝试了本页中提到的所有解决方案,但是没有用。最后,我找到了解决方案,于是想到了发布它。如果我在任何地方都不对,请纠正我。如果有时您的系统密码最近随时更改,则会出现此类错误。它将尝试从旧密码进行验证。因此,请按照下列步骤操作:
单击从库中删除
Ati*_*Asi 13
如果您更改git服务帐户(Git)的登录名或密码,则会发生这种情况。您还需要在Windows Credentials Manager中进行更改。在Windows搜索菜单中键入“凭据管理器”,将其打开。
Windows凭据管理器-> Windows凭据,然后在常规凭据下编辑您的git密码。
Wil*_*ies 11
我添加到与 Git 链接的 Bitbucket 并且不得不删除存储的密钥,因为这导致了致命错误。
要解决,我打开命令提示符并运行
rundll32.exe keymgr.dll, KRShowKeyMgr
Run Code Online (Sandbox Code Playgroud)
我删除了负责登录的密钥,下次将文件推送到存储库时,系统提示我输入凭据并输入正确的凭据,从而成功推送。
ama*_*rax 10
在Windows密码过期并更改后,我遇到了"$ git fetch fatal:'http:// ....'身份验证失败.使用Windows凭据管理器进行多次提取,重新启动甚至重新安装git都无济于事.
令人惊讶的是,正确的答案在这里的评论中,而不是在答案中(其中一些非常奇怪!).您需要转到控制面板 - >凭据管理器/ Windows凭据并更新git的密码:http:// yourrepoaddress
小智 10
就我而言,我最近更改了 Windows 密码,并且为 git 相关操作(拉、推、取等)配置了 SSH 密钥,在遇到“致命:身份验证失败”错误后,我在 Windows 中更新了密码凭据管理器(控制面板\用户帐户\凭据管理器)适用于以 git:... 开头的所有项目,并再次尝试,这次成功了!
我不确定我做了什么来得到这个错误,但做的是:
git remote set-url origin https://...
Run Code Online (Sandbox Code Playgroud)
不适合我.然而:
git remote set-url origin git@bitbucket.org:user/repo
Run Code Online (Sandbox Code Playgroud)
不知何故工作.
小智 6
我有同样的问题.我以这种方式设置url:
git remote set-url origin https://github.com/zkirkland/Random-Python-Tests.git
我也从配置文件中删除了这个条目:askpass = /bin/echo.然后"git push"问我用户名和密码,这次它有效.
如果您在 Github 帐户上启用了双因素身份验证,请登录您的 GitHub 帐户并转到:https : //github.com/settings/tokens/new 以生成新的访问令牌,复制该令牌并粘贴为用于终端身份验证的密码。
| 归档时间: |
|
| 查看次数: |
697797 次 |
| 最近记录: |