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

相关推荐
Everbrilliant8921 小时前
Xcode上编译调试ffmpeg
macos·ffmpeg·xcode·ffmpeg源码编译工具·xcode调试ffmpeg源码·ffmpeg工具环境变量配置
感谢地心引力21 小时前
iOS26 打开开发者模式
windows·macos·ios·iphone·ios26
海上生明月丿1 天前
Git介绍 && 常用命令
git
力Mer1 天前
【Git】git reset 和 git revert 的用法及示例讲解
git
角砾岩队长1 天前
Windows系统下的Git安装(2025年6月更新)
windows·git
追光天使1 天前
Mac 安装Neo4j教程
macos·neo4j
aitav02 天前
⚡ WSL2 搭建 s5p6818 Linux 嵌入式开发平台 (part 3):Wifi驱动移植、ssh移植、e2fsprogs移植
linux·wifi·ssh·嵌入式·e2fsprogs
牛奶咖啡132 天前
实现Linux的ssh免密登录实操保姆级教程
linux·ssh·生成ssh密钥对的三种方法·添加公钥到需ssh免登录服务器·测试ssh免登录的服务器·生产环境linux的优化策略
焚膏油以继晷,恒兀兀以穷年2 天前
git 基础命令学习
git·版本管理工具
一只游鱼2 天前
大文件推送到git仓库
git·git lfs