错误:克隆远程存储库“源"时出错 [英] ERROR: Error cloning remote repo 'origin'
问题描述
尝试使用configure选项,无法找到工具 配置选项和git可执行文件部分.看起来是这么回事 仅在成功构建之后发生.请帮忙.
Tried with the configure option, not able to find the tools configuration option and the git executable section. Seems like it occurs after a successful build only. Please help.
这是在控制台输出部分上构建项目后收到的输出:
Here's the output I receive after building the project on the console output section:
Building in workspace C:\Users\Anishas\.jenkins\workspace\Sample123
Cloning the remote Git repository
Cloning repository https://github.com/AnishaSalunkhe/HelloWorld.git
> C:\Users\Anishas\git init C:\Users\Anishas\.jenkins\workspace\Sample123 # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init C:\Users\Anishas\.jenkins\workspace\Sample123
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:656)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:463)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Error performing command: C:\Users\Anishas\git init C:\Users\Anishas\.jenkins\workspace\Sample123
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1726)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1695)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1691)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1321)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:654)
... 12 more
Caused by: java.io.IOException: Cannot run program "C:\Users\Anishas\git" (in directory "C:\Users\Anishas\.jenkins\workspace\Sample123"): CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:240)
at hudson.Proc$LocalProc.<init>(Proc.java:212)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:815)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1715)
... 16 more
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 22 more
ERROR: null
Finished: FAILURE
推荐答案
此浪费了很多时间在我的Jenkins Windows奴隶上.
This wasted so much time on my Jenkins Windows slave.
我知道git在路径中,因为我在构建作业的批处理命令中执行了"where git".
I knew git was in the path because I executed "where git" in the build job's batch command.
where git
C:\Program Files (x86)\Git\cmd\git.exe
显然, Jenkins Git插件在继承环境之前先执行**.
Apparently the Jenkins Git Plugin executes ** before ** the environment is inherited.
设置从站的Git路径(只需这样做!)
1)转到Windows从属配置 管理Jenkins>管理节点
1) Go to your Windows slave configuration Manage Jenkins > Manage Nodes
2)选择您的从站配置
2) Select your slave configuration
3)检查节点属性
4)输入git可执行文件的完整路径,包括git.exe
4) Enter complete path to git executable including git.exe
[x] Tool Locations
Name: (GIT) git
Home: C:\Program Files (x86)\Git\cmd\git.exe
查看屏幕截图:
这篇关于错误:克隆远程存储库“源"时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!