I have a Visual Studio Online project working with Git. Everything works fine from inside Visual Studio. I'm trying then to configure a Jenkins job that gets the code from this project, but without success. Although the URL and the credentials are correct, Jenkins gives me this error on the job configuration page:
Failed to connect to repository : Command "git.exe -c core.askpass=true ls-remote -h https://[username]:[pwd]@[domain].visualstudio.com/defaultcollection/_git/[project] HEAD" returned status code 128: stdout: stderr: fatal: repository 'https://[username]:[pwd]@[domain].visualstudio.com/defaultcollection/_git/[project]/' not found
If I save and try to build, the build fails with the following error:
unable to access 'HTTP://https:///[username]:[pwd]@[domain].visualstudio.com/defaultcollection/_git/[project]/': Could not resolve host: https
Does anyone have any idea on what can I do?
Thanks
Well, I finally made Jenkins perform the clone of a Visual Studio Online git repository.
The official Microsoft documentation is wrong. Jenkins and the Git plugin do not work as they explain there. In order to the clone operation to work, I had to put on the repository URL field the same URL used for clone in Visual Studio: https://[domain].visualstudio.com/defaultcollection/_git/[project].
Additionaly, I had to add a credential on Jenkins with the username and password for the connection to be successful. I am using the alternate credentials in Visual Studio Online.
Thanks for all the help.