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

相关推荐
0wioiw014 分钟前
Apple基础(Xcode⑤-Flutter-Singbox-AI提示词)
flutter·macos·xcode
第四维度42 小时前
【Debian】4-‌1 Gitea简介以及与其他git方案差异
git·gitea
喵手9 小时前
使用ASIWebPageRequest库编写Objective-C下载器程序
开发语言·macos·objective-c
0wioiw09 小时前
Apple基础(Xcode②-Flutter结构解析)
flutter·macos·xcode
0wioiw09 小时前
Apple基础(Xcode④-Flutter-Platform Channels)
flutter·macos·xcode
wdfk_prog13 小时前
实战指南:如何将Git仓库中的特定文件夹及其历史完整迁移到另一个仓库
大数据·linux·运维·笔记·git·学习·elasticsearch
oioihoii16 小时前
在macOS上使用VS Code和Clang配置C++开发环境
c++·macos·策略模式
键盘敲没电19 小时前
【iOS】KVO
学习·macos·ios·objective-c·cocoa
是小崔啊20 小时前
Mac配置iterm2
macos
猫头虎20 小时前
如何在 macOS 上使用 dnsmasq 搭建本地 DNS 缓存/转发
开发语言·macos·缓存·golang·beautifulsoup·beego·go1.19