I'm working with several repositories, but lately I was just working in our internal one and all was great.
Today I had to commit and push code into other one, but I'm having some troubles.
$ git push appharbor master
error: The requested URL returned error: 403 while accessing https://gavekortet@appharbor.com/mitivo.git/info/refs?service=git-receive-pack
fatal: HTTP request failed
There is nothing I can do, that would bring the password entry again.
How can I reset the credentials on my system so Git will ask me for the password of that repository?
I have tried:
git config --global --unset core.askpass
in order to unset the password
git config credential.helper 'cache --timeout=1'
in order to avoid credentials cache...
Nothing seems to work; does anyone have a better idea?
This error appears when you are using multiple Git accounts on the same machine.
If you are using MAC then you can remove the saved credentials of github.com.
Please follow below steps to remove the github.com credentials.
Done
will show
credential.helper = manager
(this is on a windows machine)To disable this cached username/password for your current local git folder, simply enter
This way, git will prompt for password every time, ignoring what's saved inside "manager".
Need to login with respective github
username
andpassword
To Clear the username and password in windows
Control Panel\User Accounts\Credential Manager
Edit the windows Credential
Remove the existing user and now go to command prompt write the push command it shows a github pop-up to enter the
username
/email
andpassword
.Now we able to push the code after switching the user.
In Windows 2003 Server with "wincred"*, none of the other answers helped me. I had to use
cmdkey
.cmdkey /list
lists all stored credentials.cmdkey /delete:Target
deletes the credential with "Target" name.(* By "wincred" I mean
git config --global credential.helper wincred
)Remove this line from your .gitconfig file located in the Windows' currently logged-in user folder:
This worked for me and now when I push to remote it asks for my password again.
In case Git Credential Manager for Windows is used (which current versions usually do):
This was added mid-2016. To check if credential manager is used: