ERROR: Error cloning remote repo 'origin' ERROR: Error cloning remote repo 'origin' git git

ERROR: Error cloning remote repo 'origin'


This wasted so much time on my Jenkins Windows slave.

I knew git was in the path because I executed "where git" in the build job's batch command.

where gitC:\Program Files (x86)\Git\cmd\git.exe

Apparently the Jenkins Git Plugin executes ** before ** the environment is inherited.

SET YOUR SLAVE's PATH to Git ( Just DO IT !! )

1) Go to your Windows slave configuration Manage Jenkins > Manage Nodes

2) Select your slave configuration

3) Check Tool Locations under Node Properties

4) Enter complete path to git executable including git.exe

[x] Tool Locations   Name: (GIT) git   Home: C:\Program Files (x86)\Git\cmd\git.exe

See screenshot:

enter image description here


Go to Manage Jenkins / Global Tool Configuration and set Path to Git executable:

enter image description here


set the path to git.exe and not only to the directory of the git file in both the locations of tool configurations.