Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git on Windows 10 - credential.helper messed up

Tags:

git

bitbucket

I am using Git (portable) on Windows 10. By some mistake I messed up my configurations for username/password and their caching timeouts.

The mistake I did was that I also installed Git for windows (not portable) and I think that's where most of the issues started. But I am not sure. Now I uninstalled it and I am back to Git portable for Windows.

I used to be able to login and not type username/password each time (for bitbucket). Now I am trying to setup again credential.helper but I am running into all sorts of issues.

1) I get this quite often: "git: 'credential-cache' is not a git command."
No idea where it comes from. Previously I didn't have it.

2) I am still being asked for password (not just the 1st time).

3) Also, I am not sure what was my previous value for credential.helper. I guess it was manager but I am finding here on SO that there's also wincred. But this wincred seems really old thing. So I guess I should set it to manager.

4) Btw, when I put manager for credential.helper, I get some weird bitbucket (browser-like) pop-up where I need to enter my username and password (btw, where does this pop-up come from? I didn't install anything from bitbucket?).

enter image description here

But when I enter username/password, it doesn't accept them and says:

fatal: HttpRequestException encountered.
    An error occurred while sending the request.
git: 'credential-cache' is not a git command. See 'git --help'.

So this time I need to enter them from the cmd promt and the next time I need to enter them again in this pop-up?!

I don't want this pop-up at all, all I want is my username/password to be saved somewhere and cached. How do I do it?

In my global (Windows user level) git config file I have this section but I am not sure if it's correct.

[credential]
    helper = cache --timeout=604800
    helper = manager
like image 881
peter.petrov Avatar asked Sep 11 '18 19:09

peter.petrov


1 Answers

You should have only one credential.helper: manager.

Try: git config -l --show-origin

For every credential.helper you see, remove it from its config file.

Then type:

git config --global credential.helper manager-core

(Note 2021: the current manager is the cross-platform GCM -- Git Credential Manager Core project)

Finally, try a git push to a bitbucket repo, re-enter your username/password (once): that should be enough.
Although, check out this thread:

(20 June 2018): Recent changes to Bitbucket authentication has also meant that you must use your email (NOT your username) when logging in.
Currently, logging in with your username is still accepted but seems to cause several issues ranging from this repeated login prompt issue to the "too many login attempts" error when pushing

like image 104
VonC Avatar answered Sep 17 '22 00:09

VonC