快车道(fastlane)- 克隆证书仓库错误

12

我在使用fastlane从BitBucket克隆git仓库时遇到了一些问题。我收到以下错误:

fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled
[17:21:34]: Exit status: 128
[17:21:34]: Error cloning certificates repo, please make sure you have read access to the repository you want to use
[17:21:34]: Run the following command manually to make sure you're properly authenticated:

我可以手动 git clone 仓库而不会遇到问题,但当我使用 fastlane 运行它时,我遇到了问题。

2个回答

2

我遇到了同样的问题,我已经添加了 github key 路径。

match(git_private_key:"/Users/ajeetsharma/Desktop/Study/Fastlane/FastLaneDemo2/fastlane/gitHubKey")

并且它已经解决了


2
这个错误意味着当使用终端提示禁用时,git找不到存储库的用户名。您可以通过尝试克隆存储库来复现此错误,例如:
$ GIT_TERMINAL_PROMPT=0 git clone https://bitbucket.org/org_name/repo_name

Git要求您手动输入用户名,因为它没有存储凭据。

由于您正在使用fastlane,我假设最有可能的原因是:您正在使用macOS,但尚未配置git-credential-osxkeychain工具,该工具从钥匙串提供凭据给git命令行工具。

  1. Run

    $ git credential-osxkeychain
    

    to verify the tool is installed.

    If this fails, either install Xcode command line tools, or run brew install git to install it.

  2. Run

    $ git config --global credential.helper osxkeychain
    

    to configure the tool.

  3. Clone your repo (git clone …) as normal and login

现在你的BitBucket凭据应该已经存储在你的钥匙串中,GIT_TERMINAL_PROMPT=0 git clone和fastlane match都应该成功。

如果你不是在macOS上,你需要为你的操作系统安装和配置类似的credential.helper


1
如果你有多个用户,而gitconfig无法重定向到本地用户,会怎么样? - Sophy Swicz
即使您有多个用户,仍应使用“--global”。全局意味着该用户的所有存储库;本地意味着仅限此存储库。 - Aaron Brager

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接