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

时间:2016-02-19 07:50:12

标签: git jenkins

我无法通过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

2 个答案:

答案 0 :(得分:1)

上下文

问题在于:Installed git version too old for credentials support

执行git --version时的结果是什么?

解决方案

将git升级到最新版本,然后重试。

答案 1 :(得分:0)

面临同样的问题 - 对我来说问题是当在机器上安装Git时,我取消选中&#34;启用凭据管理器&#34;。这给我造成了错误。 所以我卸载了Git并重新安装它并确保选中&#34;启用凭据管理器&#34;的复选框。然后它工作正常。