git-credential-osxkeychain 想要访问钥匙串中的密钥“github.com”

问题描述 投票:0回答:4

根据 github 最近删除对密码身份验证的支持 - 我按照 本指南

创建了一个 PAT

但是,每次我

git push
我都会看到“无法验证git-credential-osxkeychain的真实性。

为什么会这样?我肯定不需要每次推送都输入密码

enter image description here

git
4个回答
12
投票

git

升级
brew
后,每次使用
git
时,
OSX都会提示输入密码。要使 Keychain Access 再次信任
git
的密码,您必须打开 Keychain Access,在 Keychain: 登录名下搜索 github,kind: Internet 密码,然后将新路径添加到
git-credential-osxkeychain
。或者,只需删除 github 密码并再次重新生成个人访问令牌。 (来源:修复每个 git 事务上的 git-credential-osxkeychain 密码提示

例如,今天

brew
安装了
git-credential-osxkeychain
/usr/local/Cellar/git/2.36.0/libexec/git-core/git-credential-osxkeychain
,所以我必须将该路径添加到钥匙串访问中的密码中。

$ brew info git
…
/usr/local/Cellar/git/2.36.0 (1,544 files, 43.6MB) *
…
$ find /usr/local/Cellar/git/2.36.0 -name git-credential-osxkeychain
/usr/local/Cellar/git/2.36.0/libexec/git-core/git-credential-osxkeychain

Screenshot of password window in Keychain Access


5
投票

您可以输入密码并单击“始终允许”,这样就无需再次输入密码。

出现这种情况的可能原因是您的 Git 版本来自 Homebrew 或其他未对其软件包进行签名的来源,Apple 正在抱怨这一点。 据我所知,除了 Apple 之外,没有人发布已签名的 Git 版本,而且 Homebrew 被认为是有信誉的,因此没有理由担心。 不需要通知。


2
投票

https 克隆一直充满危险,您会看到这样的问题..此外,微软公司(于 2018 年收购了 GitHub)正试图通过隐藏 ssh 克隆并仅显示为来阻止您使用他们的命令行工具通过 https 或 他们的命令行工具

提供克隆

参见拥抱、延伸和熄灭

创建 ssh 密钥并通过 ssh 而不是 https 进行克隆


0
投票

以下脚本(在您喜欢的 shell 中复制粘贴)在正确的位置创建“git-credential-osxkeychain”的符号链接:

GIT_EXEC_PATH_LOCATION=`which git`
GIT_BASE_PATH_LOCATION=`dirname $GIT_EXEC_PATH_LOCATION`
GIT_EXEC_LOCATION=`realpath $GIT_EXEC_PATH_LOCATION`
GIT_BIN_LOCATION=`dirname $GIT_EXEC_LOCATION`
GIT_BASE_LOCATION=`dirname $GIT_BIN_LOCATION`
ln -s $GIT_BASE_LOCATION/libexec/git-core/git-credential-osxkeychain $GIT_BASE_PATH_LOCATION/git-credential-osxkeychain

然后,您应该将

which git-credential-osxkeychain
添加到始终允许访问 github.com“互联网密码”钥匙串项目的应用程序列表中,如上面 @yonran 所描述。

© www.soinside.com 2019 - 2024. All rights reserved.