【发布时间】:2021-06-09 01:45:55
【问题描述】:
- 我能够克隆公共存储库,但在使用 jenkins 时遇到了私有存储库的问题。
- 我可以使用命令提示符克隆私有仓库。
- 我可以使用 tortoise git 克隆私有 repo。
- 但无法使用 jenkins 克隆私有 repo。
Jenkins 版本:
詹金斯 2.263.4
git 路径一定没有问题。我已经解决了许多类似的问题,但没有一个答案能够解决问题。
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.com/user/module_name.git
> C:\Program Files\Git\mingw64\bin\git.exe init C:\Workspace\workspace\Walky # timeout=10
Fetching upstream changes from https://github.com/user/module_name.git
> C:\Program Files\Git\mingw64\bin\git.exe --version # timeout=10
> git --version # 'git version 2.30.1.windows.1'
using GIT_ASKPASS to set credentials Vivek git credtials for jenkins Jenkins
> C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --force --progress -- https://github.com/user/module_name.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --force --progress -- https://github.com/user/module_name.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Repository not found.
fatal: repository 'https://github.com/user/module_name.git/' not found
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:802)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1221)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1299)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
at hudson.model.Run.execute(Run.java:1907)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE
【问题讨论】: