Jenkins + Git插件CheckoutConflictException

时间:2013-03-13 19:54:00

标签: git jenkins jenkins-plugins

我正在尝试设置我的CI并且我创建了一个免费样式的作业,但是在git clone步骤中使用下面的日志失败了。我使用ssh键正确配置了计算机,但我找不到任何问题。

Using strategy: Default
Fetching changes from 1 remote Git repository
Commencing build of Revision 9560773cf0e8545f98c6700c44fd2f9ae31af904 (origin/master)
Checking out Revision 9560773cf0e8545f98c6700c44fd2f9ae31af904 (origin/master)
FATAL: Could not checkout 9560773cf0e8545f98c6700c44fd2f9ae31af904
hudson.plugins.git.GitException: Could not checkout 9560773cf0e8545f98c6700c44fd2f9ae31af904
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:68)
    at hudson.plugins.git.GitAPI.checkout(GitAPI.java:208)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1261)
    at hudson.plugins.git.GitSCM.access$1200(GitSCM.java:57)
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1220)
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1196)
    at hudson.FilePath.act(FilePath.java:865)
    at hudson.FilePath.act(FilePath.java:838)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1196)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1353)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
    at hudson.model.Run.execute(Run.java:1567)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:237)
Caused by: org.eclipse.jgit.api.errors.CheckoutConflictException: Checkout conflict with     files:
Heatmaps.framework/Headers/Heatmaps.h
Heatmaps.framework/Resources/Info.plist
Heatmaps.framework/Versions/Current/Headers
Heatmaps.framework/Versions/Current/Headers/Heatmaps.h
Heatmaps.framework/Versions/Current/Heatmaps
Heatmaps.framework/Versions/Current/Resources
Heatmaps.framework/Versions/Current/Resources/Info.plist
    at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:244)
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:64)
    ... 16 more
Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files:
Heatmaps.framework/Headers/Heatmaps.h
Heatmaps.framework/Resources/Info.plist
Heatmaps.framework/Versions/Current/Headers
Heatmaps.framework/Versions/Current/Headers/Heatmaps.h
Heatmaps.framework/Versions/Current/Heatmaps
Heatmaps.framework/Versions/Current/Resources
Heatmaps.framework/Versions/Current/Resources/Info.plist
    at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:411)
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:391)
    at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:240)
    ... 17 more

3 个答案:

答案 0 :(得分:9)

当我安装新的Jenkins 1.505并使用git客户端插件1.0.4时,我遇到了这个错误。您可以将插件降级到1.0.3,它可能会起作用。我并没有真正使用git客户端插件,因此在我的情况下将其删除

答案 1 :(得分:5)

我遇到了同样的问题。他们发布了一个更新错误的更新,因此您只需将Jenkins Git Client更新为1.0.5。现在它正在发挥作用。

答案 2 :(得分:4)

我刚遇到同样的问题,想提供另一种解决方案:

the plugin's page的1.0.4版本信息中,您可以阅读:

  

在GitAPI中使用JGit实现所有支持的方法,直到设置了org.jenkinsci.plugins.gitclient.Git.useCLI

这似乎是我们问题的原因。但它表示可以通过将org.jenkinsci.plugins.gitclient.Git.useCLI设置为true来解决问题 所以只需将-Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true添加到您的启动脚本中。

在Debian上(使用apt-get版本时),更新JAVA_ARGS中的/etc/default/jenkins就足够了(如here所述)