You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用SSH访问GitHub时bitbake recipietool的命令格式及报错解决

使用BitBake recipetool通过SSH访问GitHub仓库的正确格式

问题原因分析

从报错信息Unable to resolve 'master' in upstream git repository能定位两个核心问题:

  1. 直接用git@github.com:<username>/repo1.git格式时,recipetool错误解析URL,生成了无效的git://git@github.com/...地址
  2. 目标仓库的默认分支不是master(当前GitHub新仓库默认分支多为main),导致工具无法匹配到指定分支

正确命令格式

标准BitBake Git URI格式(推荐)

采用BitBake官方支持的Git URI规范,明确指定SSH协议和正确分支:

recipetool create "git://github.com/<username>/repo1.git;protocol=ssh;branch=<your-branch>"
  • 替换<username>为你的GitHub用户名
  • 替换<your-branch>为仓库实际的默认分支(如main)

原生SSH URL格式(带分支指定)

如果偏好原生SSH URL,可通过--srcrev参数直接指定分支:

recipetool create --srcrev <your-branch> git@github.com:<username>/repo1.git

前置验证步骤

  1. 确认SSH密钥配置正常
    先手动验证本地能通过SSH克隆仓库,排除认证问题:
git clone git@github.com:<username>/repo1.git
  1. 确认仓库分支名称
    登录GitHub查看仓库的默认分支,避免使用不存在的分支名(如master)

内容的提问来源于stack exchange,提问作者preetam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 19:42:33