How to use Git credential store on WSL (Ubuntu on Windows)?

前端 未结 5 428
有刺的猬
有刺的猬 2021-01-30 08:03

I\'ve tried following these instructions: https://stackoverflow.com/a/40312117/21728 which basically do this:

sudo apt-get install libsecret-1-0 libsecret-1-dev
         


        
5条回答
  •  梦毁少年i
    2021-01-30 08:44

    Using Windows 10 and "WSL", I created a ~/.gitconfig file, but had mistyped the [credential] section label as [credentials]. I tried running git credential fill and then feeding its output to git credential approve, which might have worked, but I suspect not since it said "usage: git credential [fill|approve|reject]". Finally, I simply ran:

    $ git config --global credential.helper cache
    

    and then did a git pull; when prompted for user and password I typed them as usual. After that, it remembered it. I found it had added the (correctly named) section to my ~/.gitconfig:

    [credential]
            helper = cache
    

    I edited that to provide a much longer timeout:

    [credential]
            helper = cache --timeout=144000
    

    And it all seems to be working nicely now.

提交回复
热议问题