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

相关推荐
Rysxt_20 小时前
Git Rebase 变基教程:作用、使用场景与合并的区别
git·变基
转战英雄枫20 小时前
Mac上打开安卓虚拟机BlueStacks Air闪退问题解决
macos·bluestacks
刘某某.1 天前
提交 git 的三种方式
git
JPX-NO1 天前
把终端玩成一场“跨次元”冒险——Termora 登场!
ssh·ftp·远程工具
bigHead-1 天前
Git 修改远程仓库地址的几种方法
git
liliangcsdn1 天前
mac m1安装homebrew和iterm2示例
macos
墨&白.1 天前
如何卸载/更新Mac上的R版本
开发语言·macos·r语言
杀手不太冷!1 天前
Jenkins的安装与使用;git clone url的时候,url为http和ssh时候的区别
git·http·jenkins
游戏开发爱好者81 天前
苹果 App 上架流程,结合 Xcode、CI 等常见工具
macos·ios·ci/cd·小程序·uni-app·iphone·xcode
wang6021252181 天前
OCR服务-本地打包docker+docker下载ssh调试
docker·ssh·ocr