Windows
首先可以考虑使用GitHub for Windows,它已经包含了该助手,或者可以下载对应系统的版本:Windows 7、Windows 8、Source 版本,然后解压缩文件并将里面的git-credential-winstore.exe 放到git 所在的目录运行即可。下次再 commit 的时候,会弹出个窗口询问用户名和密码,填写一次即可永久保存了。注意,一定要将 git-credential-winstore.exe 复制到 git 所在目录。
usage: git credential-osxkeychain <get|store|erase>
如果没有安装,那么可以使用curl下载并安装:
$ curl -s -O http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain # Download the helper
$ chmod u+x git-credential-osxkeychain # Fix the permissions on the file so it can be run
接下来,将osxkeychain安装到与Git安装目录相同的位置:
$ which git # Find where git is installed
/usr/local/git/bin/git
$ sudo mv git-credential-osxkeychain /usr/local/git/bin/ # Move the file so git can access it
Password: [enter your password]
然后,在Git的全局配置中进行设置:
$git config --global credential.helper osxkeychain