将 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 会自动使用存储的凭据

相关推荐
思盛iOS签名上架5 小时前
App苹果签名有什么作用?
macos·ios·cocoa
MartinYeung58 小时前
[论文学习]MAC:多智能体宪章学习
人工智能·学习·macos
greasyfork9 小时前
Mac Sketch v2026.3 矢量图设计工具
macos·ui·sketch
mooooooooooye10 小时前
SSH 工具越用越乱,Xterminal 先清掉这三类失效连接
运维·ssh·github
轮到我狗叫了13 小时前
git - 版本控制工具 - 对应的常见命令 - 以及无需后续每次手动source conda
git
无定义_13 小时前
萌新联赛(六)
macos·objective-c·cocoa
changxiang14 小时前
GIT 备忘
git
DogDaoDao1 天前
Windows 开发提效工具全景指南:60+ 工具的工程化分层配置
windows·git·程序员·开发工具·powershell·everything·msys2
风安•辛幸1 天前
mac上微信最新v4以上版客户端多开教程,亲测可用
macos·微信
梓沂1 天前
SSH 公钥认证配置指南:从生成密钥到配置 SFTP 服务器
ssh