git submodue fatal: unable to fork repo in bitbucket pipelines.

问题描述 投票:0回答:1

我的bitbucket仓库包含指向另一个bitbucket仓库的子模块。当我尝试用 git submodule update --init 命令。Bitbucket pipeline抛出git错误。fatal:无法分叉仓库。. 任何想法如何修复它?

bitbucket bitbucket-pipelines
1个回答
0
投票

感谢这个 文章 我的问题得以解决。

第一步

确保你的构建已经安装了 粪便ssh 客户端。因为,我是用git docker/compose:1.24.0 图像。我必须在我的 bitbucket-pipipelines.yaml 文件。

- apk add git
- apk add openssh-client

第二步

为主仓库创建SSH密钥。在bitbucket中进入你的版本库,然后点击 Repository settings > SSH keys > Generate keys 并点击 Copy public key.

第三步

添加SSH公钥到目标(子模块)仓库。在bitbucket中进入你的子模块仓库,然后点击 "添加SSH公钥"。Repository settings > Access keys 并点击 Add key 按钮,并添加在 第二步.

现在你的流水线应该可以顺利地取到依赖的子模块。

© www.soinside.com 2019 - 2024. All rights reserved.