2

I am currently installaing a pipeline for my Visual Studio projects with Jenkins (on Windows).

I installed the Git Bash and Jenkins successfully, but when I generate a new Jenkins project I need to give a Repository URL. I entered the path to my project and got the following message:

Failed to connect to repository : Error performing command: git.exe ls-remote -h file:///Users/myusername/Documents/Visual Studio 2015/Projects/QtTestApplication HEAD

I already searched for a solution and changed the user from Jenkins to the admin:

Jenkins configuration of git plugin

I double-checked the userchange in the Jenkins systeminformations (it's really running on the admin).

However i still get the same error as before and I'm not quite sure what to enter in this form. I already tried "escaping" the whitespaces like this:

Failed to connect to repository : Error performing command: git.exe ls-remote -h file:///Users/myusername/Documents/Visual\ Studio\ 2015/Projects/QtTestApplication HEAD

EDIT: Solution Part 1

I found out, that git was not found by Jenkins and that i had to add it manually to it (edit the PATH variable).

M.Winkens
  • 140
  • 2
  • 11
  • For whatever user Jenkins is running under, have you tried opening a shell and trying that exact command? That is, `git ls-remote `. Also maybe, there's a typo in your git url? Like if it's a network path, there should be four slashes after file:. So, file:////Users instead of file:///Users – solstice333 Mar 01 '18 at 12:29
  • I tried your extra slashes and the result was the same, but thanks for your reply :) – M.Winkens Mar 01 '18 at 12:51
  • Is it a local path? – solstice333 Mar 01 '18 at 12:59
  • yes, the jenkins is running on the same machine (localhost). I tried your command, too, but apprently the windows git-bash can't handle the file protocol – M.Winkens Mar 01 '18 at 13:01
  • Jenkins can actually take normal windows paths like "C:\Users\foo\bar" which are working for me now, so the problem is solved! Thanks for your help! – M.Winkens Mar 01 '18 at 13:04
  • Oh, great. I was going to suggest something like file:///c/path/to/remote.git (three slashes with the drive letter). That's how I have my local repo setup and the remote is sitting right next to it. – solstice333 Mar 01 '18 at 13:06
  • 3
    Also, this may be useful in the future: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols – solstice333 Mar 01 '18 at 13:06

0 Answers0