Git: Failed to erase credential: Element not found

前端 未结 14 1666
半阙折子戏
半阙折子戏 2020-12-09 16:42

I\'m trying to set up Git on a fresh machine, and I\'m having trouble authenticating with my remote repository.

I have limited experience with Git, but I have succes

相关标签:
14条回答
  • 2020-12-09 16:46

    Edit: It seems to be a curl bug/incompatibility with IIS when using anyauth and Windows Authentication actived

    Edit 2: It seems that installating msysgit 1.8.0-preview-20121022 fixes the problems

    Using more recente version of mssys git will fail with auth error. This can be reprocuced using curl/libcurl, the underlying Git provider for http/https.

    C:\Program Files (x86)\Git\bin\curl.exe --anyauth http://user:password@server/tfs/defaultcollection/_git/repo/info/refs?service=git-receive-pack
    

    This works well

    C:\Program Files (x86)\Git\bin\curl.exe --digest http://user:password@server/tfs/defaultcollection/_git/repo/info/refs?service=git-receive-pack
    

    So disabling Windows Authentication makes git work, but you loose everything else (access to services from VS or the TFS Management console !)

    1. On "tfs" node, activate "Digest Authentication" and disable everything else
    2. On "Team Foundation Server" node, activate "Digest Authentication" and disable everything else
    3. On "Team Foundation Server" node, do Manage Website > Restart

    Was able to push and push tags after that (from git bash and git extensions)

    Note: I use git 1.8.4.msysgit.0, git-credential-winstore 1.2 and Git Extensions 2.47.3

    Note2: Don't know if enabling other types of auths at the same time changes anything

    Note3: Not tried with passwords containing = or other "special" chars

    0 讨论(0)
  • 2020-12-09 16:46

    I was getting this error also. The only way to fix it was to create a secondary credential in visualstudio.com profile under credentials. Using the secondary credential with git extensions fixed the error.

    0 讨论(0)
  • 2020-12-09 16:47

    In my case I had to redefine (disable and enable again) Team Foundation Server alternate credentials, because password policy was strenghtened.

    0 讨论(0)
  • 2020-12-09 16:48

    I ran into this same problem recently, and it was because I wasn't using the proper url.

    bad url: https://github.com/blesh/myrepo

    good url: https://github.com/blesh/myrepo.git <-- .git !!!

    To check your remote urls:

    git remote -v
    

    To fix your remote origin url:

    git remote set-url origin https://github.com/blesh/myrepo.git
    

    Once I did this, everything worked fine again.

    0 讨论(0)
  • 2020-12-09 16:55

    EDIT: Confirmed, this seems to be an issue with Git v1.8.3 - switching to v1.8.1.2 solved the problem. Download here. Thanks for helping out!


    Well, it just so happened that a colleague of mine had the exact same problem last night, independent of this question.

    Like me, he had downloaded the latest official Git build - v1.8.3. He proceeded to uninstall the latest build and installed v1.8.1.2 instead - and that solved the problem.

    I'll give this a go when I get the chance and report back.

    0 讨论(0)
  • 2020-12-09 16:56

    Looks like the remote server is not able to authenticate you.

    You used an https:// URL. Therefore git uses https to connect to the remote repository. The server answers with 401 (Unauthorized) and your git client prints the above error message.

    Not sure, why the server does not like you. Either name/password is not correct, or something strange is going on. Try to access the https:// URL with the browser. Maybe this gives you an idea what the servers problem might be.

    You could also try to give name/password explicitly in the url: https://name:password@.... (But server will probably still refuse authentication.)

    0 讨论(0)
提交回复
热议问题