git - 如何使用 'git credential-osxkeychain store' 从命令行添加凭据?

标签 git macos

在 MacOS 中执行“git credential-osxkeychain”时,它显示选项“存储”,我猜它可以用来添加凭据。

我没有找到任何有关使用命令“git credential-osxkeychain store”添加凭据所需语法的文档,有人知道该怎么做吗?

请注意,我确实知道如何使用 MacOS 应用程序“钥匙串(keychain)访问”来执行此操作,我想知道如何使用命令行来执行此操作

最佳答案

git credential-osxkeychain store reads protocol/host/username/password从用换行符分隔的标准输入,所以给他们这样的东西:

echo "\
protocol=https
host=github.com
username=$NAME
password=$PASSWD" | git credential-osxkeychain store

所有4个参数都是required .

关于git - 如何使用 'git credential-osxkeychain store' 从命令行添加凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53419660/

相关文章:

cocoa - 通过 AuthorizationExecuteWithPrivileges 运行 sh 脚本

git - 使用 .gitconfig 配置差异工具

git - 如何使用 git filter-repo 修改远程历史记录?

macos - 在 Mac OS X 10.6.8 上使用什么来编译和模拟 Verilog 程序?

c++ - 设置库包含 C++ 中的路径

MacOSX 10.8.2 : How to clear unwanted power-management assertions?

macos - 如何限制 NSOpenPanel 中的可写目录选择?

git - 我可以在一个命令中销毁并重新创建 Git 远程分支吗?

git - 当我使用参数化分支 : fatal: Couldn't find remote ref refs/heads/${BUILD_BRANCH} 时,Jenkins 无法构建

windows - Windows 上的 Git : Why I suddenly have untracked directory that used to be tracked?