fatal: unable to get credential storage lock: File exists

后端 未结 9 1734
难免孤独
难免孤独 2021-02-05 00:24

I am using git-scm and tried to push to a repository. Upon doing so, I was greeted with the following message:

fatal: unable to get credential storage lock: File         


        
相关标签:
9条回答
  • 2021-02-05 00:42

    execute C:\Program Files\Git\mingw64\libexec\git-core>git-credential-manager.exe remove

    0 讨论(0)
  • 2021-02-05 00:46

    This is what fixed the problem for me on Window: I run git config --list --show-origin and find all credential.helper=XXX configs, then go to all directories containing those .gitconfig files and change that setting to credential.helper=store

    Also, your local config should be helper = manager too: go to .git/config and add/modify this line like this:

    [credential]
    helper = manager
    
    0 讨论(0)
  • 2021-02-05 00:47

    try to configure your credential helper without using --global

    git config credential.helper wincred
    
    0 讨论(0)
  • 2021-02-05 00:50
    • Open SmartGit then go to Edit -> Preferences -> Hosting Providers.
    • Remove Existing Provider, then click on Add Button.
    • Select "BitBucket" from Down and Click on "Generate Token" button.
    • Login by Your "BitBucket" ID and Password then copy the generate code.
    • Paste the code in Smart Git and click on "Add Button".
    0 讨论(0)
  • 2021-02-05 00:55

    I had the same issue today. It turned out that I somehow had two configs for credential.helper. Use git config --list to check whether your have multiple credential.helper="XXX".

    In my case, I had credential.helper=manager in global config and credential.helper=store in local config.

    I removed the local one in path-to-git-project/.git/config and solved the problem.

    0 讨论(0)
  • 2021-02-05 00:57

    I've had a hard time figuring out where the lock file was. On Linux, just use strace, but don't forget to follow child processes with the -f option:

    strace -f -eopen git credential-store --file=~/mystore store < creds
    open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
    open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
    open("/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
    open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
    open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    open("/dev/null", O_RDWR)               = 3
    open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
    open("/home/g179531/.gitconfig", O_RDONLY) = 3
    Process 8269 attached
    [pid  8269] open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
    [pid  8269] open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3
    [pid  8269] open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
    [pid  8269] open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
    [pid  8269] open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
    [pid  8269] open("~/mystore.lock", O_RDWR|O_CREAT|O_EXCL, 0666) = -1 ENOENT (No such file or directory)
    fatal: unable to get credential storage lock: No such file or directory
    [pid  8269] +++ exited with 128 +++
    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=8269, si_status=128, si_utime=0, si_stime=0} ---
    +++ exited with 128 ++
    

    The last file that the program tried to open before printing the error is the lock file. In my case, it's ~/mystore.lock.

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