Yocto - 使用 https 获取私人回购

Yocto - fetch private repo using https

你好 Whosebug 社区,

我正在使用 Yocto 2.2 (Morty),我想配置一个使用 https 协议获取私有 github 存储库的配方。我可以用 ssh 做到这一点,但我的限制是与机器无关,所以 https 更好。

我希望 bitbake 在执行 do_fetch() 功能时询问我的用户名和密码,但还没有得到这个结果。

我的食谱是这样配置的:

SRC_URI = "gitsm://github.com/ORGANISATION/my-depot.git;branch=master;protocol=https"

运行 bitbake 给我以下错误:

Fetcher failure: [...] git -c core.fsyncobjectfiles=0 ls-remote https://github.com/ORGANISATION/my-depot.git failed with exit code 128, output: fatal: could not read Username for 'https://github.com': No such device or address

但是,如果我在终端中复制粘贴以下命令,则会收到用户名提示:

git -c core.fsyncobjectfiles=0 ls-remote https://github.com/ORGANISATION/my-depot.git
Username for 'https://github.com':

有什么想法吗?

编辑:请注意,我也不希望我的凭据出现在 SRC_URI 标志中。

您可以将 usernamepassword 存储在 .gitconfig 中。如果您不想在 .gitconfig 中以纯文本形式存储密码,请使用 cntlm.

这里有一个有用的答案:whosebug.com/a/13230636/2689839

配置 CNTLM 后,

git config --global https.proxy https://127.0.0.1:port
git config --global http.proxy http://127.0.0.1:port