我已经尝试了三天来寻找一个解决方案,但没有成功。管道类型工作成功,自由式不工作。我注意到,在每次尝试后,在HEAD文件.git中写入“ref:refs/heads/master”,甚至我指示了 */main。
Running as SYSTEM
Building in workspace C:\Users\aziz\.jenkins\workspace\workflow
The recommended git tool is: NONE
using credential 605f1b8b-aff7-457a-8040-edf8d6dae69a
> C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\Users\aziz\.jenkins\workspace\workflow\.git # timeout=10
Fetching changes from the remote Git repository
> C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/azimkar87/Billing.git # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/azimkar87/Billing.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1003)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1244)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1308)
at hudson.scm.SCM.checkout(SCM.java:540)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1217)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
at hudson.model.Run.execute(Run.java:1897)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/azimkar87/Billing.git" returned status code 128:
stdout:
stderr: fatal: not in a git directory
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2601)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2597)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1968)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1980)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1594)
at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:991)
... 11 more
ERROR: Error fetching remote repo 'origin'
[Checks API] No suitable checks publisher found.
Finished: FAILURE
2条答案
按热度按时间8ulbf1ek1#
也许你遇到了这里描述的问题(https://community.jenkins.io/t/upgrading-git-on-jenkins-master-causing-failures-for-multibranch-pipelines/3247),升级git可以解决这个问题。
velaa5lx2#
尝试在git资源库url的末尾添加一个斜杠