当我使用 Git 创建 Jenkins 作业来管理源代码时,我输入了本地存储库 URL,但失败了:
Failed to connect to repository: Command"git ls-remote -h /myRepositoryPath HEAD" returned status code 128:
stdout:
stderr:fatal: '/myRepositoryPath' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
我通过终端尝试了这个命令,它起作用了,因为我已经初始化了目录并提交了它。我猜匿名用户导致发生此错误,有人可以帮忙吗?
答案1
您使用哪种 URL?如果使用git@...
,则必须通过密钥进行登录,并且您应该将文件放置id_rsa
到id_rsa.pub
jenkin 的~/.ssh
目录中。