设置 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 文件中,后续操作会自动使用。

相关推荐
一枕槐安4874 小时前
RAG 服务扛住高并发:缓存、队列、限流三件套
java·spring·缓存·异步任务·rag·断路器
不老刘7 小时前
Antigravity 的 New Worktree 模式:给 AI 代理一个安全的“平行工位”
人工智能·git·ai编程·antigravity
光谱SpectrAI7 小时前
Windows 也中招:Git Bash 和 Node 仍信任泄露的 eMudhra 证书
git
YIN_尹8 小时前
【git原理与使用】git初识与安装
大数据·git·elasticsearch
Leo_Mr12 小时前
Vue3 项目配置 Git 提交规范(企业通用方案:husky + commitlint + cz-git + lint-staged)
git
与数据交流的路上13 小时前
一次 redis 幽灵内存的分析
数据库·redis·缓存
jyOverQ13 小时前
Git rebase 和 merge 有什么区别?什么时候该用哪个?
git
晗夜未央13 小时前
跨仓库 Skill 换台电脑就失效?用 Git remote 校验项目
人工智能·git·python
Lsetea13 小时前
Git访问HTTPS证书不受信任:用URL级sslCAInfo限定私有CA范围
git·https·开发工具·ssl证书·ca证书
Geek-Chow13 小时前
06 · DeepSeek V4.1 Flash 推理端到端走查:一个 Agent 请求穿过 recipe、KV 缓存、Prefill 与 Decode
缓存