Git 1.8.0支持与gnome-keyring集成。
http://www.h-online.com/open/news/item/Git-1-8-0-can-access-Windows-and-GNOME-keyrings-1733879.html
在阅读了有关git凭据帮助程序的文档后:http://git-scm.com/docs/gitcredentials.html
我找不到使用这个新功能的方法。我如何集成它?我使用的是Archlinux,其中git是从Archlinux的存储库安装的。(git 1.8.0)
发布于 2012-11-15 10:51:50
Git 1.8.0提供了gnome-keyring支持,但二进制文件需要针对您的平台进行编译。
这就是我在Archlinux中解决这个问题的方法:
$ sudo pacman -S libgnome-keyring
$ cd /usr/share/git/credential/gnome-keyring
$ make
$ git config --global credential.helper /usr/share/git/credential/gnome-keyring/git-credential-gnome-keyring@VonC解决方案已关闭,但git config命令应指向可执行文件。这就是为什么它对我不起作用。
发布于 2013-01-26 02:45:34
@marcosdsanchez的答案是给Arch的(它回答了最初的问题),但我使用的是Ubuntu。对于git >= 2.11:
sudo apt-get install libsecret-1-0 libsecret-1-dev
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret对于git < 2.11:
sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring发布于 2012-11-15 04:02:59
更新Q4 2016:
git配置--全局credential.helper库密钥
(参见"Error when using Git credential helper with gnome-keyring")
git配置--全局credential.helper管理器
(参见"How to sign out in Git Bash console in Windows?":即使用最新的 )
原始答案(2012)
适用于Windows、Mac和Unix平台的凭证助手首先在"git-credential-helper" repo,中引入,现在已经包含在git发行版中
Git这个存储库包含一组
凭证助手(
gitcredentials(7)),它们是git的一部分(或打算在将来提供)。
$ git clone git://github.com/pah/git-credential-helper.git
$ BACKEND=gnome-keyring # or any other backend
$ cd git-credential-helper/$BACKEND
$ make
$ cp git-credential-$BACKEND /path/to/git/crendential构建时,它将安装在/path/to/git/credential目录中。
要使用此后端,您可以通过设置
将其添加到(全局) Git配置中
(此处适用于Unix):
git config --global credential.helper /path/to/git/credential/gnome-keyring/git-credential-gnome-keyringWindows注意事项:
我想你可以编写一个在Windows上运行的程序,然后调用一个像"pypi keyring 0.10“这样的库。
但这是后端,您不能直接从Git使用它。
您正在使用的是一个“凭证助手”(反过来,它将调用any credential API it wants on Windows)。
GitHub for Windows提供了这样一个帮助器(作为一个可执行文件,称为...github),并可以在Windows会话期间存储您的凭据。
从"GitHub for Windows“窗口启动一个shell,您将看到,输入"git config --system -l":
C:\Users\VonC\Documents\GitHub\test [master +2 ~0 -0 !]> git config --system -l
credential.helper=!github --credentialscredential.helper=!github --credentials部件将调用凭证助手'github‘。
$ git config [--global] credential.helper $BACKENDhttps://stackoverflow.com/questions/13385690
复制相似问题