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

相关推荐
小皮侠21 分钟前
nginx的使用
java·运维·服务器·前端·git·nginx·github
HalukiSan1 小时前
如何提交PR
git·gitlab·github
Charlene Fung2 小时前
vs code远程自动登录服务器,无需手动输入密码的终极方案(windows版)
运维·服务器·vscode·ssh
不学会Ⅳ4 小时前
Mac M芯片搭建jdk源码环境(jdk24)
java·开发语言·macos
小林up4 小时前
github push:ssh: connect to host github.com port 22
运维·ssh·github
爱莉希雅&&&12 小时前
shell编程之awk命令详解
linux·服务器·git
baiyu3313 小时前
成为git砖家(12): 看懂git合并分支时冲突提示符
git
wu_aceo17 小时前
将本地项目提交到Gitee
git·gitee·提交·本地提交·上传git
青芒亭18 小时前
vscode remote-ssh 拓展免密访问 linux虚拟机
linux·vscode·ssh
一世一生命1 天前
Windows下Gitlab多账号(3个及以上)SSH配置
运维·ssh·gitlab