From a blog I found:
This [git-credential-cache] doesn’t work for Windows systems as git-credential-cache communicates through a Unix socket.
Git for Windows
Since msysgit has been superseded by Git for Windows, using Git for Windows is now the easiest option. Some versions of the Git for Windows installer (e.g. 2.7.4) have a checkbox during the install to enable the Git Credential Manager. Here is a screenshot:
Still using msysgit? For msysgit versions 1.8.1 and above
The wincred
helper was added in msysgit 1.8.1. Use it as follows:
git config --global credential.helper wincred
For msysgit versions older than 1.8.1
First, download git-credential-winstore and install it in your git bin directory.
Next, make sure that the directory containing git.cmd
is in your Path environment variable. The default directory for this is C:Program Files (x86)Gitcmd on a 64-bit system or C:Program FilesGitcmd on a 32-bit system. An easy way to test this is to launch a command prompt and type git
. If you don't get a list of git commands, then it's not set up correctly.
Finally, launch a command prompt and type:
git config --global credential.helper winstore
Or you can edit your .gitconfig
file manually:
[credential]
helper = winstore
Once you've done this, you can manage your git credentials through Windows Credential Manager which you can pull up via the Windows Control Panel.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…