Jenkins git-lfs错误记录

 问题记录:

Jenkins构建时报git-lfs相关错误,如:

hudson.plugins.git.GitException: Command "git checkout -f 96b9583cbb1f2b7a5afe1d063b7f8680caa8db4c" returned status code 1:

stdout:

stderr: HEAD is now at 96b9583c 1.修复bug

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.

hudson.plugins.git.GitException: Command "git checkout -f 96b9583cbb1f2b7a5afe1d063b7f8680caa8db4c" returned status code 128:

stdout:

stderr: git-lfs filter-process: git-lfs: command not found

fatal: The remote end hung up unexpectedly


解决方法:

终端git --exec-path,打印出的路径为:/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core,将/usr/local/bin/git-lfs拷贝到上述git-core路径下,重新构建后成功。

参考:https://github.com/git-lfs/git-lfs/issues/640