git - 如何为 GitLab CI 克隆私有子模块 GitHub
问题描述
我有以下情况:我正在使用来自 GitHub 的私有子模块执行 GitLab CI,并在我的管道中获取下一条消息:
致命:无法读取“https://github.com”的用户名:没有这样的设备或地址致命:将“https://github.com/username/project”克隆到子模块路径“/my_gitlab_username/my_gitlab_project”失败
致命:无法读取“https://github.com”的用户名:没有这样的设备或地址致命:将“https://github.com/username/project”克隆到子模块路径“/my_gitlab_username/my_gitlab_project”失败
第二次克隆 'submodule_name' 失败,中止
如何设置令牌或有助于克隆 GitHub 私人仓库的东西?
解决方案
要克隆存储库,您可能需要使用令牌:
git config --global credential.helper 存储
git clone https://your_username:your_github_token@github.com/username/private-repo.git
否则使用 curl api 调用
推荐阅读
- mysql - 选择mysql返回0行
- c# - Create dictionary outside and initialize it using LINQ
- javafx - Cleaning up bindings and change listeners on nested properties when parent properties change in javafx
- docker - 你推荐在 WSL 上使用 Docker 吗?还是更好地在 Windows 上本地使用?
- c++ - 在不更改选择的情况下更新 QTreeView
- cmd - 如何首先列出具有文件夹名称的指定驱动器上的所有文件夹,然后是间隙然后是文件夹的完整路径?
- rendering - dompdf 在 1 行中渲染完整的 html
- r - Rstudio 项目导致 rsession 内存永远增加
- xml - XSLT - Nested XML to CSV output
- css - SVG CSS animation after hover off