【问题标题】:Error building project from GitLab: "terminal prompts disabled"从 GitLab 构建项目时出错:“终端提示已禁用”
【发布时间】:2025-12-22 09:00:10
【问题描述】:

我开始使用 Read the Docs with GitLab。我用 Sphinx 建立了一个项目并将其连接起来。每次在 RTD 触发构建时,都会显示以下消息:

git clone --no-single-branch --depth 50 https://gitlab.com/ldesousa/docs-repo .
Cloning into '.'...
fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled 

该项目在本地建设良好。我还在项目的根目录下添加了.readthedocs.yml文件,但问题依旧。

【问题讨论】:

    标签: gitlab read-the-docs


    【解决方案1】:

    您可以按照“Documentation using Sphinx and ReadTheDocs.org”中的说明尝试使用 SSH URL:

    git remote add origin git@github.com:<your git username>/my-first-docs.git
    

    在您的 Git 克隆命令中,尝试使用类似的 SSH URL。

    【讨论】:

    • 您链接到的页面解释了如何设置开发环境。如果我正确理解你的答案,我必须在 RTD 环境中做类似的事情。但是,到目前为止,我发现的唯一机制是 requirements.txt 文件。您能否详细说明如何在 RTD 做到这一点?
    • @LuísdeSousa 我没有实验环境,但想法是:如果您在当前设置中的任何位置指定了 HTTPS URL,请尝试用 SSH URL 替换它。
    • 我没有具体说明 RTD 的构建环境。我也找不到任何地方去做。