2016-02-19 135 views
0

连接到Git仓库,我无法通过詹金斯连接到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: 
[email protected] [email protected] 
[email protected] 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 

回答

1

语境

这里的问题是:Installed git version too old for credentials support

结果是什么时候你执行git --version

解决方案

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

+0

我的本地git版本是2.6.3,但是这个jenkins是在远程机器上,在詹金斯的git插件版本是2.4.0 – Tanushree

+0

Jenkins git插件使用安装在该机器上的git。确保在Jenkins机器上更新git(git可执行文件)。 – michaelbahr

+0

如果你得到'error:unknown option'local'',那么远程计算机上的Git版本就非常老了 - 这个选项是在几年前增加的。 –

0

面临同样的问题 - 我的问题是,当在机器上安装Git时,我未选中“启用凭证管理器”。这对我造成了错误。 因此,我卸载Git并重新安装它,并确保选中“启用凭证管理器”复选框。然后它运行良好。