设置 Git 凭据缓存(针对 HTTPS)

1. 启用凭据缓存

bash 复制代码
git config --global credential.helper cache

默认缓存时间为 15 分钟,可以设置更长时间(例如 1 小时,3600 秒):

bash 复制代码
git config --global credential.helper 'cache --timeout=3600'

2. 使用凭据存储(永久保存用户名和密码)

bash 复制代码
git config --global credential.helper store

在下一次执行 git clone 或 git pull 时,输入一次用户名和密码,Git 会将它们存储在 ~/.git-credentials 文件中,后续操作会自动使用。

相关推荐
会飞的青蛙1 小时前
GIT 配置别名&脚本自动化执行
前端·git
权咚2 天前
阿权的开发经验小集
git·ios·xcode
-Xie-2 天前
Mysql杂志(十六)——缓存池
数据库·mysql·缓存
七夜zippoe2 天前
缓存与数据库一致性实战手册:从故障修复到架构演进
数据库·缓存·架构
weixin_456904272 天前
跨域(CORS)和缓存中间件(Redis)深度解析
redis·缓存·中间件
MarkHard1232 天前
如何利用redis使用一个滑动窗口限流
数据库·redis·缓存
心想事成的幸运大王3 天前
Redis的过期策略
数据库·redis·缓存
nightunderblackcat3 天前
新手向:Git下载全攻略
git
wuyunhang1234563 天前
Redis---集群模式
数据库·redis·缓存
没有bug.的程序员3 天前
Redis 大 Key 与热 Key:生产环境的风险与解决方案
java·数据库·redis·缓存·热key·大key