将 SSH 密钥添加到 macOS 的钥匙串中

git提交代码时,如果SSH密码并未免密,每次拉取,上传操作时都需要密码输入,

可将SSH`密钥添加到钥匙串中

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

报错:

WARNING: The -K and -A flags are deprecated and have been replaced

by the --apple-use-keychain and --apple-load-keychain

flags, respectively. To suppress this warning, set the

environment variable APPLE_SSH_ADD_BEHAVIOR as described in

the ssh-add(1) manual page.

Identity added: /Users/menmen/.ssh/id_rsa (xxx@xxx.com)

通常是在将 SSH 密钥添加到 macOS 的钥匙串中时出现的,在 macOS 上使用的,它指出 -K-A 标志已经被弃用。

解决:

在添加 SSH 密钥时,使用新的标志,不会在出现弃用警告

html 复制代码
ssh-add --apple-use-keychain ~/.ssh/id_rsa

之后,在该仓库中的操作将不再需要输入用户名和密码,git 会自动使用存储的凭据

相关推荐
CoderJia程序员甲33 分钟前
GitHub 热榜项目 - 日榜(2026-02-03)
git·ai·开源·llm·github
宴之敖者、35 分钟前
Linux——git和gdb
linux·运维·git
2601_949146531 小时前
APP语音通知接口集成实战:移动端应用接入语音提醒API的开发手册
macos·objective-c·cocoa
辰风沐阳1 小时前
git 忽略大小写(重命名文件)
大数据·git·elasticsearch
天麓2 小时前
git rebase 举例
git
艺杯羹2 小时前
Git文件状态管理:从基础到进阶的完整指南
大数据·git·elasticsearch·版本控制·git教程·代码管理·git基础
Tony Bai2 小时前
Git 即数据库:Beads (bd) —— 专为 AI Agent 打造的分布式任务追踪引擎
数据库·人工智能·分布式·git
是店小二呀2 小时前
Git多人协作深度实践指南
大数据·git·elasticsearch
Warren982 小时前
Allure 常用装饰器:实战用法 + 最佳实践(接口自动化)
运维·服务器·git·python·单元测试·自动化·pytest
小鹿软件办公3 小时前
Apple 发布 macOS 11、watchOS 10 和 watchOS 9 更新
macos·objective-c·cocoa