无法将jenkins连接到远程git存储库

时间:2018-08-22 11:41:43

标签: git jenkins remote-server ssh-keys

我正在尝试将我的詹金斯车连接到远程git仓库,例如aa-bb-server

在凭据配置中,我输入了用户名和私钥,这就是我得到的:

Failed to connect to repository : Command "git ls-remote -h aa-bb-server HEAD" returned status code 128:
stderr: fatal: 'aa-bb-server' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

将Jenkins用户更改为root无效。

我可以在本地SSH回购,克隆等。

1 个答案:

答案 0 :(得分:1)

嗨,请按照以下步骤操作 如果您在服务器上安装了jenkins,请初始化git空存储库-> git init

然后转到github->单击个人资料下拉菜单-> 设置-> 开发者设置-> 个人访问令牌-> 生成新令牌-> 选择所有范围-> 复制令牌

然后转到Jenkins-> 管理Jenkins -> github设置-> 添加用户-> 选择秘密文本**-> **粘贴令牌

  

并测试您的git hub访问权限   之后,转到项目并添加您的存储库URL(以.git结尾)

相关问题