title: Jenkins git authentication failed with correct credentials on Windows
body: <p>I'm currently using Jenkins on <strong>Windows 10</strong>, and using git as version control system.
  Although I provided correct repository URL and credential, I cannot use jenkins with error below.</p>
  <pre><code>Failed to connect to repository : Command &quot;git.exe ls-remote -h REPOSITORY_URL HEAD&quot; returned status code 128:
  stdout:
  stderr: git@URL: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  <p>Credential and URL doesn't seems wrong, since this build success previously with same credential. The only change after successful build was one line in build script.</p>
  <pre><code>git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
  </code></pre>
  <p>After I success with this script, git setting keeps failed. Is there any problem with that line? And how can I fix it?</p>
  <p><strong>EDIT</strong> <br/>
  Problem solved! For anyone who has same problem, it was problem with the system user! Since ssh key stores in each user space, jenkins cannot detect where the ssh key located. Therefore, go to 'service' in windows, and change user of jenkins service to the user who has correct ssh key. It solved my problem!</p>