结帐Bitbucket Repo Branch in Jenkins

发布于 2025-02-13 20:15:01 字数 2085 浏览 0 评论 0原文

我是詹金斯(Jenkins)的新手,并尝试创建一条管道并从詹金斯(Jenkins)结帐私人位桶存储库,然后安装依赖项,然后创建构建。

但是我在结帐存储库分支时在第一步中出现问题。
我也设置了凭据和SSH链接。

这是错误:

The recommended git tool is: NONE
using credential 02cb4299-3a20-424f-a541-1771e5b2e0b9
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe rev-parse --resolve-git-dir C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\SCM-Pipline\.git # timeout=10
Fetching changes from the remote Git repository
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe config remote.origin.url ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/ # timeout=10
Fetching upstream changes from ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe --version # timeout=10
git --version # 'git version 2.37.0.windows.1'
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe fetch --tags --force --progress -- ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/ +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'

这是代码:

pipeline {
 agent any
  stages {
  stage('Git Checkout') {
  steps { 
    git branch: 'master',
        credentialsId: '<credentialIdsHere>', // changed
        url: 'ssh://[email protected]:company/repo.git/' // changed
   }
  }
 }
}

我也指定了git.exe路径

”在此处输入图像说明”

I am new with Jenkins and trying to create a pipeline and checkout the private BitBucket repository from Jenkins and then install dependencies and then create build.

But I am having issue in the first step while checkout the repository branch.
I have set the credentials and SSH link as well.

Here is the Error:

The recommended git tool is: NONE
using credential 02cb4299-3a20-424f-a541-1771e5b2e0b9
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe rev-parse --resolve-git-dir C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\.jenkins\workspace\SCM-Pipline\.git # timeout=10
Fetching changes from the remote Git repository
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe config remote.origin.url ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/ # timeout=10
Fetching upstream changes from ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe --version # timeout=10
git --version # 'git version 2.37.0.windows.1'
C:\Users\ahsan.alam\AppData\Local\Programs\Git\bin\git.exe fetch --tags --force --progress -- ssh:///[email protected]:Arsalanakhtar123/etisalat-jenkins.git/ +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'

Here is the code:

pipeline {
 agent any
  stages {
  stage('Git Checkout') {
  steps { 
    git branch: 'master',
        credentialsId: '<credentialIdsHere>', // changed
        url: 'ssh://[email protected]:company/repo.git/' // changed
   }
  }
 }
}

Also I have specify the git.exe path

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月染过的梦 2025-02-20 20:15:01

假设SSH正在起作用,这意味着您可以手动执行git ls-remote(例如)到该ssh url,我建议使用语法(对于所述ssh url):

ssh://[email protected]/company/repo.git
                      ^^^ (/, not :)
# or
[email protected]:company/repo.git/
                ^^^ (OK, but no ssh:// prefix)

Assuming SSH is working, meaning you can execute manually a git ls-remote (for instance) to that SSH URL, I would recommend the syntax (for said SSH URL):

ssh://[email protected]/company/repo.git
                      ^^^ (/, not :)
# or
[email protected]:company/repo.git/
                ^^^ (OK, but no ssh:// prefix)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文