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

相关推荐
他们都不看好你,偏偏你最不争气12 小时前
【iOS】 单例模式
macos·objective-c·cocoa
小毛驴85015 小时前
所有微服务部署都使用一个git地址,并且通过docker部署各个服务的情况下,如何编写mvn指令来处理各个服务。
git·docker·微服务
软件测试很重要15 小时前
UOS20系统安装与 SSH/XRDP 远程访问功能配置指南
linux·运维·ssh
国王不在家15 小时前
git 切换仓库后清理分支缓存
git
FreeBuf_19 小时前
苹果用户速更新!macOS存严重漏洞,用户隐私数据面临泄露风险
macos
Thomas214319 小时前
macos deepctr_torch虚拟环境配置
macos
wxl78122719 小时前
MacOS 运行CosyVoice
macos·cosyvoice·语音自然
柯南二号19 小时前
【Gitlab】Ubuntu 20.04服务器部署Gitlab
git·gitlab
phac12319 小时前
git 如何直接拉去远程仓库的内容且忽略本地与远端不一致的commit
大数据·git·elasticsearch
lichong95120 小时前
【混合开发】vue+Android、iPhone、鸿蒙、win、macOS、Linux之video 的各种状态和生命周期调用说明
android·vue.js·macos