Task: Jenkins Workspaces

Hello,

I’m having troubles to connect to the git repo from jenkins. I tried to execute the command “git ls-remote -h – root@localhost:sarah/web_app.git HEAD” in the jenkins server but it keeps asking for a password for root in localhost (see screenshot) which I do not know. I also changed the Host Key Verification Strategy to no verification but still getting the same error: "Failed to connect to repository : Command “git ls-remote -h – root@localhost:sarah/web_app.git HEAD” returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
root@localhost: Permission denied (publickey,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists."


You try to connect to local repository in localhost by root user. So, localhost asks you root password.
Is this what you want (I don’t know where repo must be)?
ls-remote example for the remote server:
git ls-remote http://www.kernel.org/pub/scm/git/git.git
Or with user:
git ls-remote ssh://user@server/git.git

Hi bhard,

Thank you for your reply. I think that there is a problem with the repo’s url in gitea. This is the path ‘root@localhost:sarah/web_app.git’ that I obtained when copy the repo path for ssh connections.

Solved!!! I didnt need to use ssh since the repo was public!