Hi,
To avoid this error, you have to set your git path in jenkins. Follow the below given steps.
Go to jenkins-> Manage jenkins-> Global Tool Configuration->inside git add path.
Before that check git path where you installed in your system.
For windows system use Get-Command git.exe | Select Definition.
For Linus system use which git.
Hope this will help you.