设置 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 完全指南 —— 第1章:Git 概览与版本控制演进
git
ofoxcoding20 小时前
在AI API聚合平台配置DeepSeek V3.2提示词缓存实战:快速接入与成本优化指南
人工智能·spring·缓存·ai
noravinsc21 小时前
关于Git Flow
git
蜜獾云21 小时前
在Git中配置用户名和密码
git
NeilYuen1 天前
gRPC结合FAISS构建AI助手语义缓存模块(一):设计
人工智能·缓存·faiss
scx_link1 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
taocarts_bidfans1 天前
反向海淘跨境缓存架构优化:taocarts Redis分层缓存实战技术
redis·缓存·架构·反向海淘·taocarts
南大白1 天前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
退休倒计时1 天前
【每日一题】LeetCode 146. LRU 缓存 TypeScript
算法·leetcode·缓存·typescript