如何存储Gerrit密码?

How to store Gerrit password?

我想知道如何存储 Gerrit 密码,因为每次我需要与远程存储库交互时它都会询问我的密码。

您需要 install/configure 一些 "Credential helper" 以避免重复输入您的凭据。

要了解有关该执行的更多详细信息:

git help credentials

遵循一些凭据帮助程序选项:

Ubuntu

Ubuntu 的一个很好的凭证助手是 git-credential-libsecret。要 install/configure 它执行:

sudo apt-get install libsecret-1-0 libsecret-1-dev
sudo make -C /usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret

其他 Unix

可以使用git-credential-cache。它不需要安装,因为它在 Git 包中。要配置它执行:

git config --global credential.helper 'cache --timeout 3600'

Windows

我认为 Windows 的一个不错的选择是 Git Credential Manager for Windows