为了账号安全,请及时绑定邮箱和手机立即绑定

构建报错:The recommended git tool is: NONE

Started by user rootRunning as SYSTEM
Building remotely on TestEnv in workspace /root/.jenkins/workspace/DeployOrder
The recommended git tool is: NONE
using credential 6d01249a-9773-4e97-b40b-5bab042e231c
 >  /usr/local/bin/git rev-parse --resolve-git-dir /root/.jenkins/workspace/DeployOrder/order/.git # timeout=10
ERROR: Workspace has a .git repository, but it appears to be corrupt.
hudson.plugins.git.GitException: Error performing git command:  /usr/local/bin/git rev-parse --resolve-git-dir /root/.jenkins/workspace/DeployOrder/order/.git
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2679)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2601)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2597)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1968)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1980)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.hasGitRepo(CliGitAPIImpl.java:395)
	at hudson.plugins.git.GitAPI.hasGitRepo(GitAPI.java:241)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:924)
	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(Remo

我做了哪些排查


http://img1.sycdn.imooc.com//625d60970001915311200566.jpg

git 公钥和私钥配置是OK的


http://img1.sycdn.imooc.com//625d60eb0001d90311960566.jpg


【我做了哪些尝试】 

    我按照这篇博客 https://www.cnblogs.com/panda-123/p/14456428.html 操作改成 main 不行


    

  我按照  https://stackoverflow.com/questions/8639501/jenkins-could-not-run-git 这篇提问中解决办法尝试


    http://img1.sycdn.imooc.com//625d61530001222220381084.jpg

这是我本地配置


http://img1.sycdn.imooc.com//625d629c0001a65021020738.jpg


这是我TestEnv 环境的


http://img1.sycdn.imooc.com//625d624d00011b7d11940212.jpg



这是我本地Mac

http://img1.sycdn.imooc.com//625d62d80001df2408160294.jpg



正在回答

1 回答

解决方案:你需要配置Git在服务器上的运行地址

具体可参考https://blog.csdn.net/weixin_40816738/article/details/90280863

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

构建报错:The recommended git tool is: NONE

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信