Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: Failed to erase credential: Element not found

Tags:

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 successfully done the following before:

  • Create local repository ($git init)
  • Connect with remote repository ($git remote add origin https://[my remote repository])

Everything goes well up until this point. However, when I try to interact with the remote repository - pull, clone or push - either through command line or TortoiseGit, I am greeted with the following error message upon entering my credentials:

Failed to erase credential: Element not found

fatal: Authentication failed for https://[my remote repository]

It obviously seems like some sort of authentication issue - however, I can log into the web interface of the remote repo just fine, so I'm certain I'm using the correct un/pw. I've installed the Windows Credential Store for Git, but that throws the exact same error message.

Google hasn't been much help - this solution seems to be Vista / 32bit specific (I'm Win7 / 64bit), and this SO question has been removed, leaving me none the wiser.

Now, I'm sure there's a simple solution to my problem, but I've been at it all day with no progress. Anybody able to give me a pointer?

Thanks in advance!

Edit: Here's the full results of a clone command:

I:\KODE\_Git\myproject>git clone https://...

Cloning into 'myproject'...

Username for 'https://...': myuser

Password for 'https://myuser[at]...':

fatal: Authentication failed for 'https://...'

like image 974
Medjeti Avatar asked Jun 12 '13 20:06

Medjeti


People also ask

How do I find my git credential password?

With the default configuration of git on windows, this is stored in Windows under: control panel => User => Credential manager .

How do I update my git credential helper?

To update your credentials, go to Control Panel → Credential Manager → Generic Credentials. Find the credentials related to your Git account and edit them to use the updated password. This should be the accepted answer if git config --list contains credential. helper=wincred .


2 Answers

I had the same error in windows. It happened after i changed the credentials in the Control panel -> Users -> Manage credentials.

I fixed it by adding a new credential:

git:https://github.com (web credentials) and username and password.

like image 192
Erik Avatar answered Sep 16 '22 13:09

Erik


I had this problem with github. In my case the source of the problem was Two-factor authentication. I had it turned on, and when I turned it off - I got rid of that credential-error.

That's a shame though that I have to keep Two-factor authentication off because of it.

like image 40
retif Avatar answered Sep 20 '22 13:09

retif