Reputation:
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.
Upvotes: 0
Views: 3261
Reputation: 36
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
Upvotes: 2