git - 来自 Jenkins 的 Git 结帐错误,状态码为 128
问题描述
当我尝试使用 jenkins 从 Git 签出项目时,有时我会遇到此错误。我的 Jenkins 项目是管道项目。
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --no-tags --progress https://hqreadonlyuser@bitbucket.highq.com/scm/col/collaborate.git +refs/heads/*:refs/remotes/origin/* --depth=1" returned status code 128:
stdout:
stderr: fatal: Unable to create 'D:/jenkins_slave/workspace/Collaborate/Automation/File/File_7/oldAutomationTests/.git/shallow.lock': File exists.
解决方案
您可以在您的 repo 目录中使用以下命令:-
对于Linux:-
rm -r /home/myuser/my_source_code/.git/shallow.lock
对于 Windows:-
cd .git del shallow.lock
您还可以安装“pre-scm build”插件和 pre-scm 步骤以无条件地删除 .git 目录中的锁定文件,如果您经常看到这种情况足以证明更改作业定义的合理性。
推荐阅读
- excel - 引用另一个工作表的条件格式在启用宏的工作表中不起作用
- node.js - 如何为流创建“缓存”或“存储桶”?
- verilog - Verilog 模拟中针对端口大小的意外警告
- c++ - 如何在 C++ 中多次重复一个整数
- python - 结合聚类条形图和多折线图
- c++ - 如果 std::vector
被重写为使用标准向量实现,这将如何破坏旧软件? - string - 如何在 BigQuery 强制字符串类型中加载镶木地板文件?
- javascript - 如何在角度中使用 ngx translate 和这个选择
- python - 列内的重复行 - python/pandas
- asp.net-core-3.1 - System.Text.Json ASP.NET Core 3.1 的特定日期时间格式