即使所有更改都是在没有合并冲突的情况下推送的,合并时也会出现 Git 错误

发布于 2025-01-11 16:03:27 字数 3089 浏览 0 评论 0原文

在推送我的更改后,我在 Jenkins 构建上看到了一些有关 git 的错误。我将尝试在这里解释这个场景:

在这里,我正在处理我的本地分支 - develop,它是从 ma​​ster 分支克隆的。

  • 我对我的开发分支做了一些更改将更改推送到主分支。
  • 我在Stash上看到了一些合并冲突。
  • 因此,我使用 master 将 master 拉入我的开发分支

git pull origin master

  • 解决冲突后,我推送了更改,但在我的构建管道中遇到了这个问题。我在本地以及 Stash 的 UI 中看不到任何冲突问题。
  • 我看不到任何需要在本地提交的更改,使用命令进行验证,但它没有显示任何抢占的更改

git 状态

错误消息


[2022-03-04T20:02:25.315Z] ERROR: Checkout failed

[2022-03-04T20:02:25.315Z] hudson.plugins.git.GitException: Command "git merge 7b22e11d41ecfcc22ce4bf5e3f7d9948fc3be363" returned status code 128:

[2022-03-04T20:02:25.315Z] stdout: 

[2022-03-04T20:02:25.315Z] stderr: error: 'merge' is not possible because you have unmerged files.

[2022-03-04T20:02:25.315Z] hint: Fix them up in the work tree,

[2022-03-04T20:02:25.315Z] hint: and then use 'git add/rm <file>' as

[2022-03-04T20:02:25.315Z] hint: appropriate to mark resolution and make a commit,

[2022-03-04T20:02:25.315Z] hint: or use 'git commit -a'.

[2022-03-04T20:02:25.315Z] fatal: Exiting because of an unresolved conflict.

[2022-03-04T20:02:25.315Z] 

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1996)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1987)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$600(CliGitAPIImpl.java:84)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$3.execute(CliGitAPIImpl.java:955)

[2022-03-04T20:02:25.315Z]  at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:121)

[2022-03-04T20:02:25.315Z]  at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1164)

[2022-03-04T20:02:25.315Z]  at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1303)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:154)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:145)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)

[2022-03-04T20:02:25.315Z]  at hudson.model.ResourceController.execute(ResourceController.java:99)

[2022-03-04T20:02:25.315Z]  at hudson.model.Executor.run(Executor.java:432)

[2022-03-04T20:02:25.315Z] ERROR: Maximum checkout retry attempts reached, aborting

提前致谢!

I'm seeing some errors regarding git on Jenkins build after pushing my changes. I will try to explain the scenario here:

Here, I'm working on my local branch say - develop which was cloned from the master branch.

  • I made some changes in my develop branch & pushed the changes against the master branch.
  • I saw some merge conflicts on the Stash.
  • Hence, I took the pull of master into my develop branch using

git pull origin master

  • After resolving the conflicts, I pushed the changes but got this issue in my build pipeline. I can't see any conflict issue in my local as well as Stash's UI.
  • I can't see any changes left to commit in my local, verified using the command, but it doesn't show any upstaged changes

git status

Error message


[2022-03-04T20:02:25.315Z] ERROR: Checkout failed

[2022-03-04T20:02:25.315Z] hudson.plugins.git.GitException: Command "git merge 7b22e11d41ecfcc22ce4bf5e3f7d9948fc3be363" returned status code 128:

[2022-03-04T20:02:25.315Z] stdout: 

[2022-03-04T20:02:25.315Z] stderr: error: 'merge' is not possible because you have unmerged files.

[2022-03-04T20:02:25.315Z] hint: Fix them up in the work tree,

[2022-03-04T20:02:25.315Z] hint: and then use 'git add/rm <file>' as

[2022-03-04T20:02:25.315Z] hint: appropriate to mark resolution and make a commit,

[2022-03-04T20:02:25.315Z] hint: or use 'git commit -a'.

[2022-03-04T20:02:25.315Z] fatal: Exiting because of an unresolved conflict.

[2022-03-04T20:02:25.315Z] 

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1996)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1987)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$600(CliGitAPIImpl.java:84)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$3.execute(CliGitAPIImpl.java:955)

[2022-03-04T20:02:25.315Z]  at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:121)

[2022-03-04T20:02:25.315Z]  at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1164)

[2022-03-04T20:02:25.315Z]  at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1303)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:154)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:145)

[2022-03-04T20:02:25.315Z]  at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)

[2022-03-04T20:02:25.315Z]  at hudson.model.ResourceController.execute(ResourceController.java:99)

[2022-03-04T20:02:25.315Z]  at hudson.model.Executor.run(Executor.java:432)

[2022-03-04T20:02:25.315Z] ERROR: Maximum checkout retry attempts reached, aborting

Thanks in advance !!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文