简体   繁体   English

Jenkins(Windows)无法通过git(Linux)存储库克隆

[英]Jenkins(Windows ) unable to clone through git(Linux) repository

Set-up Details: 设置详细信息:

JENKINS on windows 10 Windows 10上的JENKINS

GIT plugin setup done GIT插件设置完成

public private key setup done 公私钥设置完成

Cloning repository through CMD works 通过CMD克隆存储库 通过CMD克隆存储库

git clone through Jenkins fails with below error 通过Jenkins进行git clone失败并出现以下错误

"C:\Program Files (x86)\Jenkins\workspace\Aclselenium>git clone rahulp@10.0.6.194:/Operations/repo/git/test.git 
Cloning into 'test'...
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

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

JENKINS控制台日志

Running below commands through windows cmd 通过Windows cmd在命令下方运行

"whoami" command gives > "acl-wireless\rahulp"

"echo %USERNAME%" command gives `> "rahulp"`

Where as when I run above command through JENKINS I receive: 当我通过JENKINS运行以上命令时,我收到:

"whoami" command gives > "nt authority\system"

"echo %USERNAME%" command gives `> "RAHULPANDEY$ RAHULPANDEY$"`

Your command line access to git and your jenkins access to git are two different things. 你的命令行访问git和你jenkins获得git是两个不同的东西。 From command line, you will be given your username and password to login. 在命令行中,将为您提供usernamepassword进行登录。 But from jenkins you need to configure credentials. 但是您需要从jenkins配置凭据。 Go to Manage Jenkins => Configure System => GitHub and please give the credentials there. 转到Manage Jenkins => Configure System => GitHub然后在此处提供凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM