git - 安装 libsecret 凭据帮助程序后出现 git push 错误:“credential--h”不是 git 命令
问题描述
我按照此处的说明安装了 libsecret 凭据帮助程序:https ://www.softwaredeveloper.blog/git-credential-storage-libsecret
现在,当我推送时git: 'credential --h' is not a git command. See 'git --help'
,即使推送成功,我也会收到错误消息。为什么?
输出git config -l --show-origin | grep credential
:
file:/home/alex/.gitconfig credential.helper=/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
file:.git/config credential.helper=-h
解决方案
问题是您输入了不正确的.git/config
. 这很可能只是一个错字,这实际上并不少见。当您将凭证帮助程序指定为单个单词时,Git 会git credential-
在它前面添加,从而产生您看到的消息。
要修复它,只需.git/config
使用您喜欢的编辑器编辑文件并删除不正确的条目。
它继续工作的原因是因为 Git 使用每个凭证助手来查询然后批准或拒绝凭证。结果,您的功能性 libsecret 凭证助手仍然被调用,它提供了您需要的凭证,而损坏的条目仅被调用以批准这些凭证,从而导致您看到的错误。
推荐阅读
- html - 如何在悬停时将文本向左移动?
- postgresql - postgres ORDER BY - 如何获得排序顺序以考虑任何字母在数字或标点符号之前
- html - 我在 100% 宽度的 2 个图像之间有一个空格
- mysql - PHP 嵌套循环 - 根据每周可用时间获取生产订单就绪日期
- algorithm - 解决追逃游戏
- graphql - 查询组件集成在功能组件内部
- java - Firebase 错误:“反序列化时需要一个列表,但有一个类 java.util.HashMap”
- javascript - 点击后如何保持模式打开?
- php - 从 URL 和 product.php?name=$1 中删除 %20 个空格
- sql-server - 将存储过程的结果与临时表连接起来