为什么通过哈德森的git获取失败,而通过命令行的git获取工作? [英] Why does git fetch via hudson fail, while git fetch via the command line works?

查看:127
本文介绍了为什么通过哈德森的git获取失败,而通过命令行的git获取工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从github中获取一个只读的git仓库,并通过hudson来构建它。

这是哈德森输出:

由SCM更改开始
签出:workspace / d:\ hudson \home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
使用策略:默认
Checkout:workspace / d:\ hudson \home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
GitAPI创建
从远程Git存储库获取更改
从git获取上游更改://github.com/malaterre/gdcm.git
[workspace] $C:\程序文件(x86)\Git\bin\git.exe fetch -t git://github.com/malaterre/gdcm.git + refs / heads / *:refs / remotes / origin / *
[workspace] $C:\程序文件(x86)\\ \\Git\bin\git.exels-tree HEAD
错误:从原始/来源获取问题 - 可能无法使用。无论如何继续
错误:无法从任何存储库中获取
致命错误:无法从任何存储库中获取
hudson.plugins.git.GitException:无法从任何存储库获取
at hudson .plugins.git.GitSCM $ 2.invoke(GitSCM.java:674)
at hudson.plugins.git.GitSCM $ 2.invoke(GitSCM.java:641)
at hudson.FilePath.act(FilePath .java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:641)
at hudson。 model.AbstractProject.checkout(AbstractProject.java:1061)
at hudson.model.AbstractBuild $ AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild $ AbstractRunner.run(AbstractBuild。 java:411)
at hudson.model.Run.run(Run.java:1273)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model .ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:129)

当我通过git bash命令行直接运行这个获取命令时,我没有得到任何回应(我认为这意味着它已经工作)。



我看着这个可能的解决方案:
http://issues.hudson-ci.org/browse/HUDSON-7141?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel



但是使用该版本的插件并没有改变这种行为。



我甚至没有得到让它与cmake一起工作,只是一直下载。我怎样才能得到这个工作?



编辑:这个问题不是repro的使用Git插件在Hudson上运行Git插件问题,因为我没有作为服务运行服务器。

解决方案

是的,我刚解决了这个问题。如果你打开一个Windows资源管理器来 d:\ hudson \home\jobs\gdcm-hudson\workspace ,你应该可以看到一个 .git 目录,而不是别的。应该有一个工作副本,但没有。为了解决这个问题,你必须运行

  git pull git://github.com/malaterre/gdcm .git 

这应该在 d:\中创建一堆其他文件hudson \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'

I'm trying to fetch a read-only git repository from github and have it be built via hudson. This process is failing.

This is the hudson output:

Started by an SCM change
Checkout:workspace / d:\hudson\home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
Using strategy: Default
Checkout:workspace / d:\hudson\home\jobs\gdcm-hudson\workspace - hudson.remoting.LocalChannel@19ba1d8
GitAPI created
Fetching changes from the remote Git repository
Fetching upstream changes from git://github.com/malaterre/gdcm.git
[workspace] $ "C:\Program Files (x86)\Git\bin\git.exe" fetch -t git://github.com/malaterre/gdcm.git +refs/heads/*:refs/remotes/origin/*
[workspace] $ "C:\Program Files (x86)\Git\bin\git.exe" ls-tree HEAD
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:674)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:641)
    at hudson.FilePath.act(FilePath.java:753)
    at hudson.FilePath.act(FilePath.java:735)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:641)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1061)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
    at hudson.model.Run.run(Run.java:1273)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:129)

When I run that fetch command directly via the git bash command line, I get no response (which I assume means it's worked).

I looked at this possible solution: http://issues.hudson-ci.org/browse/HUDSON-7141?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

But using that version of the plugin did not change this behavior.

I haven't even gotten to having it work with cmake yet, just downloaded consistently. How can I get this to work?

edit: This problem is not a repro of Problem cloning / fetching repository using Git plugin for Hudson on Windows, because I'm not running as a service on a server.

解决方案

Yes, I just fixed this exact problem. If you open a windows explorer to d:\hudson\home\jobs\gdcm-hudson\workspace you should be able to see a .git directory and nothing else. There should be a working copy but there isn't. To fix this you have to "prime" the repository by running

git pull git://github.com/malaterre/gdcm.git

This should create a bunch of other files in d:\hudson\home\jobs\gdcm-hudson\workspace along side the .git directory and you should be able to perform a build in hudson.

这篇关于为什么通过哈德森的git获取失败,而通过命令行的git获取工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆