Change to the user that runs the jenkins jobs and run the command manually:

git ls-remote -h HEAD

You will get the standard SSH warning when first connecting to a new host via SSH:

The authenticity of host ‘ (’ can’t be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?

Type yes and press Enter. The host key for will now be added to the ~/.ssh/known_hosts file and you won’t get this error in Jenkins anymore.

By admin