如何在Windows上存储Git的身份验证凭据?

如何在Windows上存储Git的身份验证凭据?,windows,git,github,Windows,Git,Github,我试着用这个答案,但没用。 此时会弹出一个GUI对话框 fatal: HttpRequestException encountered. An error occurred while sending the request. fatal: HttpRequestException encountered. An error occurred while sending the request. Username for 'https://github.com': email@do

我试着用这个答案,但没用。

此时会弹出一个GUI对话框

fatal: HttpRequestException encountered.
   An error occurred while sending the request.
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
Username for 'https://github.com': email@domain.com
Password for 'https://email@domain.com@github.com':
remote: Counting objects: 10, done.
...
 2 files changed, 11 insertions(+), 5 deletions(-)

C:\Users\Chloe\workspace\catalyst_research>git config --global credential.helper "cache --timeout=2592000"

C:\Users\Chloe\workspace\catalyst_research>git pull
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
git: 'credential-cache' is not a git command. See 'git --help'.
Username for 'https://github.com': email@domain.com
Password for 'https://email@domain.com@github.com':
git: 'credential-cache' is not a git command. See 'git --help'.
Already up to date.

C:\Users\Chloe\workspace\catalyst_research>git pull
fatal: HttpRequestException encountered.
   An error occurred while sending the request.
git: 'credential-cache' is not a git command. See 'git --help'.
Username for 'https://github.com': ^C

首先,将管理器保留为凭据帮助器:

git config --global credential.helper manager
第二,当弹出窗口出现时,输入您的GitHub帐户用户名/密码

然后,后续的Git命令将不再要求您提供凭据

如果您的凭据确实与
https://github.com

Username for 'https://github.com': email@domain.com

注意:您的GitHub用户名应该是您的GitHub帐户用户名,而不是
email@domain.com

我将Git升级到2.16.3版,它运行正常

chocolatey upgrade git
chocolatey upgrade git