git 凭证助手不起作用

mty*_*son 4 git credentials git-bash

我正在尝试保存我的 git 密码以避免每次都输入。

我在 Windows 10 上使用 git bash。

每次我点击远程时,git 都会继续要求输入密码。

(是 git bash 为什么它不起作用?)

我试过了:

git config --global credential.helper 'cache --timeout 28800'
Run Code Online (Sandbox Code Playgroud)

和:

git config --global credential.helper store
Run Code Online (Sandbox Code Playgroud)

和:

git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)

我已经在 git bash 和 cmd 中都试过了,所以我猜不是 git bash 导致了这个问题。

Von*_*onC 7

首先,对于 Windows,要使用的凭据帮助程序是manager

git config --global credential.helper manager
Run Code Online (Sandbox Code Playgroud)

其次,这仅适用于 HTTPS URL,不适用于 SSH URL ( user@server.com)

对于 SSH,它是:

  • 要求输入密码,因为您的私人 SSH 密钥受密码保护。
    如果是这种情况,请检查 ssh-agent:请参阅“将 SSH 密钥添加到 ssh-agent
  • 要求 matt 的密码,因为它在远程服务器 art 上找不到您的公钥~matt/.ssh/authorized_keys