-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins: v2.361.1
Git Plugin: v4.12.1
The v4.12.1 git plugin breaks when doing "git lfs install" during a Jenkins job. The attached image shows the error. It also breaks the command on the machine in the repo directory. It works when I delete the repo folder on the machine and rerun the job, but when I re-run it again it will always break.
Error has a weird path "\NUL:\pre-push" and saying that the path is incorrect. Not sure why it cannot go to .git\pre-push.
The issue was never there. I can confirm that having the git plugin on v4.11.5 works really fine.
You might try allowing hooks on the agent as described in the "Security Configuration" section of the git plugin documentation. You may also consider moving the git lfs install call to be performed once per agent rather than once per job. Large file storage only needs to be initialized once per account.
I've confirmed in my installation that if git hooks are enabled on the Windows agent, then you can call git lfs install without issue. It appears that git lfs install on Windows does not like the way that we prevent the execution of checkout hooks on the agent.
If you must perform the git lfs install in a Freestyle job, another option is to install the pre-scm step plugin and add a pre-scm step that performs the bat command git lfs install before the SCM checkout happens.
A Pipeline option is to perform the git lfs install before the checkout scm. If you're using declarative Pipeline, then you'll need to add the skipDefaultCheckout option, otherwise there will already be a default checkout before the git lfs install is run.