0

It's a while I don't push code on my github account.

Today as I tryed to

git push -u origin master

my command prompt (Anaconda) asked me to type in my github username and password

Logon failed, use ctrl+c to cancel basic credential prompt.

Username for 'https://github.com/': myusername

Password for 'https://myusername@github.com/':

I typed those in, and then the prompt responded with:

fatal: unable to get credential storage lock: File exists

I can push the code with no problem, but I would prefer that I don't have to type in my user and password every time.

I did a bit search and I found out the error I am having is ponted out in this thread, where it is suggested that the error is caused by having more than one credential.helper= code line in git configurations. It is also suggested that by leaving just one of these lines, it adjusts the error.

So, by typing

git config --list

I found out that I have two code lines credential.helper= in my .git/config file.
One is in system config file, and one in global config file

git config --list --system

credential.helper=manager

git config --list --global

credential.helper=store

But in my .git/config file I can't find any line starting with credential.helper=.

So where can I find these lines?

And Should I delete either credential.helper=store or credential.helper=manager to avoid to type in my credentials every time?

Tms91
  • 3,456
  • 6
  • 40
  • 74

1 Answers1

2

There is a stuck .git-credentials.lock file in your home directory. It probably contains your password in plaintext, so you should remove it.

git-credential-store:

Using this helper will store your passwords unencrypted on disk, protected only by filesystem permissions. If this is not an acceptable security tradeoff, try git-credential-cache, or find a helper that integrates with secure storage provided by your operating system.

You should stick to the OS provided manager.

You can show which file a setting is coming from by using the --show-origin option of git config.

But you can also remove it with the command git config --unset --global credential.helper.

krisz
  • 2,686
  • 2
  • 11
  • 18