git - Jenkins :错误:获取远程仓库时出错 'origin'

标签 git jenkins jenkins-plugins

我是 Jenkins 的相对新手,我试图简单地从 Bitbucket 上存储的代码运行构建。我正在使用 git。我已将作业源代码控制设置为 https 协议(protocol):
网址:https://myaccount@bitbucket.org/myaccount/myrepo.git
凭据:用户名/密码

'build' 部分指向根目录中的 pom.xml 并运行干净的测试 maven 目标

我有 Git 插件 2.5.2

我正在将 Jenkins 作为 Windows 服务(Windows 10)运行。

构建项目的错误是

ERROR: Timeout after 10 minutes

git.exe config --local --remove-section credential # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://username@bitbucket.org/username/myrepo.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404) Caused by: hudson.plugins.git.GitException: Command "git.exe -c core.askpass=true fetch --tags --progress https://username@bitbucket.org/username/myrepo.git +refs/heads/:refs/remotes/origin/" returned status code -1:



欢迎任何建议

最佳答案

正如我在这里回答的那样 https://stackoverflow.com/a/43964812/908936 :

尝试禁用使用 git 凭据缓存

git config --global --unset credential.helper

你可能还需要做
git config --system --unset credential.helper if this has been set in the system config file

关于git - Jenkins :错误:获取远程仓库时出错 'origin',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38391601/

相关文章:

git - 如何使用 Ansible 将代码从本地 git 存储库部署到远程服务器

ios - 克隆存储库并仍然从原始源获取更新?

git - GIT 是否基于日期时间 merge ?

linux - java.lang.NoSuchMethodError : No such DSL method 'bash' found among steps 错误

git - 自动 merge 2 个 git 分支的脚本?

github - Gulp不会在 Jenkins (Jenkins)工作

html - 如何在 Jenkins 构建页面上流式传输 mp4 神器

security - jenkins 访问被拒绝 - asdf@gmail.com 缺少读取权限

git - 将提交添加到 merge 的分支并开始新的 pull 请求

jenkins - 无法使用jenkins参数化远程触发插件