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

相关推荐
FserSuN21 小时前
Git Worktree 使用学习
git·学习
Z文的博客21 小时前
嵌入式LINUX QT 开发 .gitignore 文件编写指南
linux·git·qt·elasticsearch·嵌入式
无效的名字21 小时前
mac下安装openclaw
macos
00后程序员张21 小时前
完整指南 iOS App上架到App Store的步骤详解
macos·ios·小程序·uni-app·objective-c·cocoa·iphone
YaBingSec21 小时前
玄机网络安全靶场:GeoServer XXE 任意文件读取(CVE-2025-58360)
java·运维·网络·安全·web安全·tomcat·ssh
前端双越老师21 小时前
3 个命令 7 个步骤,学会 git worktree 并行开发
git·ai编程·全栈
开开心心loky1 天前
[OC 底层] (二)类与对象底层原理
macos·ios·objective-c·cocoa
小黑要努力1 天前
智能音箱遇到的问题(一)
linux·运维·git
RePeaT1 天前
【git】指令场景实战:单分支与多分支协作流程
git
前端Hardy2 天前
杀疯了!Git 2.54 正式发布,3个封神新特性,效率直接翻倍!
git