【发布时间】:2020-10-19 17:11:04
【问题描述】:
我正在尝试在 CI 中编译一些 Rust 代码,这依赖于另一个私有 git 存储库。 由于它在 CI 中,我无法手动输入凭据,所以我正在尝试使用 git-credentials-store。这是我在尝试设置 git-credentials-store 时所做的:
echo 'https://username:password@placeholder.com/repo.git' > git-credentials
git config credentials.helper 'store --file git-credentials'`
要构建项目,它必须从该私有 git 存储库中获取。 当它尝试构建时,它失败了,说这是它尝试的命令:
git fetch --tags --force --update-head-ok 'https://placeholder.com/git/repo.git' 'refs/heads/*:refs/heads/*'
这是错误信息:
fatal: could not read Username for 'https://placeholder.com': No such device or address
这是否表明它要求在标准输入中输入用户名?我希望该命令会使用 git-credentials 文件中的用户名和密码。
【问题讨论】:
-
您的示例在一处使用
placeholder.eu,在其他地方使用placeholder.com。我认为这是一个疏忽。 -
是的,谢谢,已更正
标签: git continuous-integration credentials rust-cargo