Jenkins管道:git-lfs:找不到命令

问题描述

我有一个配置为从Git版本控制运行脚本的Jenkins Pipeline Job。我已经给出了一个存储库路径,但是在结帐时失败,找不到git lfs命令。

[Pipeline] End of Pipeline
    hudson.plugins.git.GitException: Command "git checkout -f 0dac40f9a4f8908d177e319b2742908018663eb1" returned status code 128:
    stdout: 
    stderr: git-lfs smudge -- 'testlfs.txt': git-lfs: command not found
    error: external filter git-lfs smudge -- %f failed -1
    error: external filter git-lfs smudge -- %f failed
    fatal: testlfs.txt: smudge filter lfs failed


    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1000(CliGitAPIImpl.java:80)
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2681)
    Caused: hudson.plugins.git.GitException: Could not checkout 0dac40f9a4f8908d177e319b2742908018663eb1
        at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2705)
        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1195)
        at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
        at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
        at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    Finished: FAILURE

如何解决此问题?请帮忙!

解决方法

这是错误报告的JENKINS-52857,并且解决方法是手动创建的链接

ln -s /usr/local/bin/git-lfs /usr/local/Cellar/git/2.21.0/libexec/git-core/git-lf

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...