Git在默认配置下是不会存储你的帐号密码的。虽然可以配置为在内存中保存,或者以明文形式保存在文件中,但还是不怎么方便。Windows下有微软写的凭证管理器,那么在Linux下就有Gnome的Libsecret了。

Git本身是自带了配置工具的源代码,只不过是要自己编译而已。使用以下命令安装库、编译并设置就可以了。

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

Ref: https://www.softwaredeveloper.blog/git-credential-storage-libsecret

分类: Linux

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注