简体   繁体   English

无法通过Jenkins连接到Git存储库

[英]Unable to connect to Git repository through Jenkins

I am unable to connect to git repository through Jenkins it gives 我无法通过Jenkins连接到git存储库

[WARNING] Installed git version too old for credentials support

 git config --local credential.username # timeout=10
 git config --local --remove-section credential # timeout=10 Could not remove the credential section from the git configuration

ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from "repository
name"   at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:763)     at
hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)     at
hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)    at
hudson.scm.SCM.checkout(SCM.java:485)   at
hudson.model.AbstractProject.checkout(AbstractProject.java:1276)    at
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    at
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)  at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)     at
hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410) Caused by:
hudson.plugins.git.GitException: Command "git config --local
credential.username prajaktam" returned status code 129: stdout: 
stderr: error: unknown option `local' usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE    use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot   find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte


    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1616)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1612)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1608)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1337)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:62)
    at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:313)
    at
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
    at
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
    at hudson.remoting.UserRequest.perform(UserRequest.java:120)    at
hudson.remoting.UserRequest.perform(UserRequest.java:48)    at
hudson.remoting.Request$2.run(Request.java:326)     at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)     at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at hudson.remoting.Engine$1$1.run(Engine.java:62)   at
java.lang.Thread.run(Thread.java:744)   at ......remote call to Jenkins
Slave(Native Method)    at
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
    at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)  at
hudson.remoting.Channel.call(Channel.java:781)  at
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
    at sun.reflect.GeneratedMethodAccessor428.invoke(Unknown Source)    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)     at
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
    at com.sun.proxy.$Proxy47.execute(Unknown Source)   at
hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)    ... 11 more
ERROR: null Archiving artifacts Sending e-mails to:
prasad.msrk@sonata-software.com tridev.k@sonata-software.com
krishnachanikya.d@sonata-software.com Warning: you have no plugins
providing access control for builds, so falling back to legacy
behavior of permitting any downstream builds to be triggered Finished:
FAILURE

Context 语境

Here is the problem: Installed git version too old for credentials support 这是问题所在: Installed git version too old for credentials support

What is the result when you execute git --version ? 执行git --version的结果是什么?

Solution

Upgrade git to the latest version and try again. 将git升级到最新版本,然后重试。

Was facing the same issue - the problem for me was that when installing Git on the machine, I unchecked "Enable credential manager". 面临相同的问题-对我来说,问题是在计算机上安装Git时,我未选中“启用凭据管理器”。 This caused the error for me. 这为我造成了错误。 So I uninstalled Git and reinstalled it and made sure to check the checkbox for "Enable credential manager". 因此,我卸载了Git并重新安装了它,并确保选中“启用凭据管理器”复选框。 Then it worked fine. 然后工作正常。

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

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