簡體   English   中英

使用jenkins進行git checkout期間發生異常:“無此文件或目錄”

[英]Exception during git checkout using jenkins: “No such file or directory”

我正在嘗試從詹金斯投票git repo。 但是它拋出異常。

FATAL: Could not checkout null with start point 1abd809011d37508b783f4f74245178ed632295a
hudson.plugins.git.GitException: Could not checkout null with start point 1abd809011d37508b783f4f74245178ed632295a

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkoutBranch(CliGitAPIImpl.java:1274)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:881)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1411)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:560)
at hudson.model.Run.execute(Run.java:1670)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: hudson.plugins.git.GitException: Command "git checkout -f 1abd809011d37508b783f4f74245178ed632295a" returned status code 128:
stdout: 
stderr: error: unable to create file sparkIncentiveCommon/src/main/java/com/ebay/spark/incentiveService/supportedpayment/SparkSupportedPaymentIncentiveRequest.java (No such file or directory)
fatal: cannot create directory at 'sparkIncentiveService/src/main/webapp/META-INF/configuration/QA/config/com/ebay/domain/core/common/featurecontingency': No such file or directory

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1148)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1125)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1121)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:937)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:947)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkout(CliGitAPIImpl.java:1248)
at hudson.plugins.git.GitAPI.checkout(GitAPI.java:208)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkoutBranch(CliGitAPIImpl.java:1258)
... 9 more

Jenkins版本-1.549 Git插件版本-2.0.1

最后,用於Windows的本機git具有長路徑選項:

msysgit開發團隊已在msysgit 1.9.0中實現了似乎是解決方案的解決方案。 似乎需要專門啟用該解決方案,但是它可能允許您通過安裝msystgit 1.9.0並運行來解決此問題。

git config --global core.longpaths是

請參閱https://github.com/msysgit/git/commit/c5f98452e98dca292c615000df7973ead63cf29b了解有關該選項的更多詳細信息。 您可能僅應在遇到問題時啟用該選項,因為msysgit人士警告說,在核心git中啟用長路徑時,其他工具可能存在兼容性問題。

我們有同樣的問題。 經過一些研究,似乎在Windows環境下,Jenkins git插件無法應對太長的路徑(> 259個字符)。 更准確地說-git插件在最新版本中通過命令行使用git,因此無法解決路徑太長的問題。 以前它使用的JGit實現沒有此問題。 您仍然可以使用Jenkins命令行參數切換回此實現:

“ -Dorg.jenkinsci.plugins.gitclient.Git.useCLI = false” (與奴隸相同)

或者只是在Jenkins配置對話框中選擇JGit作為實現。

一切順利。 但是請不要忘記JGit不是功能齊全的本地git!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM