如何永久存储 git HTTPS 密码/凭据以便你只需输入一次
注意:自 2021 年起,我强烈建议使用 git credential manager core 而不是使用此旧方法。请参见如何在 Ubuntu 20.04 上安装 git credential manager core
问题:
每次克隆 git 仓库或 push/pull 时,你必须输入用户名和密码(例如用于 GitHub 或你的 GitLab 安装)。 相反,你希望 git 存储密码以便你只需输入一次。
解决方案
配置 git 凭据助手使用明文存储而不是默认缓存:
git_store_credentials.sh
git config --global credential.helper store注意:此方法会将你的密码存储在明文文件中,因此根据你的设置这可能会有安全风险。
Check out similar posts by category:
Git, Version Management
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow