Question

I am trying to connect Jenkins to my git repository (not GitHub). Jenkins returns the following message:

Failed to connect to repository : Command "git ls-remote -h git@localhost/~/shoppinglist HEAD" returned status code 128:
stdout:
stderr: fatal: 'git@localhost/~/shoppinglist' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

The URL I'm providing is:

git@localhost/~/shoppinglist

If I run the command git ls-remote -h git@localhost/~/shoppinglist HEAD on the console with the jenkins user, it doesn't throw any errors (or any output). I specify the password with credentials, "Username with password", username: git, password: my password.

Was it helpful?

Solution

You could try :-

1) put private key in .ssh for jenkins user

2) set Manage Credentials in Jenkins to access .ssh folder

As described in Jenkins plus Git on same server

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top