Jenkins出现了陈旧的分支和远程git服务器有冲突, 如下:
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@XXX
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:894)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1161)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- git@XXX +refs/heads/*:refs/remotes/origin/*" returned status code 1:
stdout:
stderr: error: cannot lock ref 'refs/remotes/origin/xxx': 'refs/remotes/origin/xxx' exists; cannot create 'refs/remotes/origin/xxx'
From xxx
! [new branch] xxx -> origin/xxx (unable to update local ref)
error: some local refs could not be updated; try running
'git remote prune xxx' to remove any old, conflicting branches
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1866)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:547)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:892)
... 11 more
在网上找了很多方法都不行, 去国外网站找了一圈也没有答案, 想了想, Jenkins的git流水线插件不应该做得那么搓, 绝对会把这个问题考虑进去了, 从生产流水线语法入手查查有没有更好的方法:
流水线语法的入口有2个地方:
1)
2)?
进去之后呢, 如下:
看的时候感觉上面部门, 就是一些git的常用配置, 感觉都没有特别, 再往下一看:
没错, 就是它(PruneStaleBranch), 可以修建修剪陈旧的远程跟踪分支, 在这里补上, 重新点击构建, 成功了:
?
从Win7开始,微软就大刀阔斧改进系统搜索功能。但即使到了现在,Win10经历了数个...
CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页。 /*注释区域*/...
在生活中有一种东西几乎已经快要成为我们的另一个电子”身份证“,那就是二维码...
3.有两个关系SA,B,C,D和TC,D,E,F写出与下列查询等价的SQL表达式 首先建立表 CREA...
结构化查询语言SQL在20世纪70年代发展起来之后,很快就成为关系数据库的标准语言...
IT之家12月23日消息 外媒 Windows Latest 报道,随着 Windows 10 版本 2004 的发...
如果纯粹是为了挑战自己的正则水平,用来实现一些特效(例如使用正则表达式计算...
一、数据库命令规范 所有数据库对象名称必须使用小写字母并用下划线分割 所有数...
一、概述 Redis是一个开源的使用ANSI C语言编写、遵守BSD协议、支持网络、可基于...
题目描述 “总之就是不太可爱” TC学长对字符串很有研究在他看来有些字符显然不...